-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: calculate shipping tax using cart items #1283
feature: calculate shipping tax using cart items #1283
Conversation
I'd much rather go a step further and would introduce shipping calculation strategies, where you can register services, these services gets displayed in a combobox and you can choose between them, wdyt? |
Like we start with our two strategies, and register them for example as service with the symfony tagging system? Then people are able to register their own service, which will then be displayed in the combobox?! |
yep |
BTW: If you are not sure how to implement it, we have several examples of how that is done in CoreShop. eg. CoreShop Index |
I will take a look at the current implementations and update this PR asap. |
What is the reason of adding the fields 'Stores' and 'Tax Rate' (see Screenshot of PR description) in ExtJS via
|
cause the shipping bundle doesn't know anything about stores nor taxes. only the core-bundle does |
src/CoreShop/Bundle/CoreBundle/Migrations/Version20200213132916.php
Outdated
Show resolved
Hide resolved
src/CoreShop/Bundle/ShippingBundle/DependencyInjection/Compiler/ShippingTaxStrategyPass.php
Outdated
Show resolved
Hide resolved
src/CoreShop/Bundle/ShippingBundle/Resources/config/serializer/Model.Carrier.yml
Outdated
Show resolved
Hide resolved
src/CoreShop/Bundle/ShippingBundle/Resources/config/services/shipping-rules.yml
Outdated
Show resolved
Hide resolved
src/CoreShop/Bundle/ShippingBundle/Resources/public/pimcore/js/carrier/item.js
Outdated
Show resolved
Hide resolved
src/CoreShop/Bundle/ShippingBundle/Resources/translations/admin.de.yml
Outdated
Show resolved
Hide resolved
src/CoreShop/Component/Core/Order/Processor/CartTaxProcessor.php
Outdated
Show resolved
Hide resolved
General question. I'm thinking about naming and maybe ShippingTaxCaluculation would be more appropiate than ShippingTaxStrategy?! |
|
Sounds good. I will do it |
Is this ready to be reviewed and tested? FYI: Travis currently fails cause Pimcore 6.5.2 is broken... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realised, this cannot be finished yet. Carrier Price Calculation also knows about tax and needs to use the tax-calc service as well, right?
src/CoreShop/Bundle/ShippingBundle/Resources/config/pimcore/routing.yml
Outdated
Show resolved
Hide resolved
src/CoreShop/Component/Shipping/Taxation/TaxCalculationStrategyCartItems.php
Outdated
Show resolved
Hide resolved
Not sure where else the Carrier Price Calculation takes place. I just know of the CartProcessors which listen to cart updates. But yes, The Carrier price calculation always depends on these tax-calc services i think. |
… calculation will work.
@solverat could you review that as well pls? |
big thanks @lukadschaak |
Moin!
@dpfaffenbauer , do you remember the shipping tax calculation in germany? We spoke about that in the training and you implemented some stuff.
This PR implements the possibility to select a service, that will calculate the tax amount of the shipping price. In some countries the shipping price will have fix tax rate. In other countries, for example in Germany, the tax amount for the shipping cost is variable. It depends on the tax rate of the cart items. When all Items have the same tax rate, the shipping tax is the same (7% or 19%). If there are items with different tax rates in cart, it gets complicated.
With this Feature you can implement your own service and define your own tax calculation. Also the two ways of calculation are pre-implemented.
The Code is WIP. First of all i want to know if @dpfaffenbauer wants this feature in core and if you are happy with this way of implementing this feature. If yes i would finish the code and try to add tests.
On the following screen you see the combobox i added.