skijump Posted November 4 Share Posted November 4 I'm looking for help applying tax to the final price of an order, not the pre-discount total. Currently taxes are applied to the "pre-discount total" and added to the final discounted price. Example: Total Products: $100.00 Total Discounts: $20.00 Pre-Tax Total: $80 Taxes at 10%: $10 Total: $90 The taxes should be $8, not $10. I've searched the web numerous times but haven't found a solution yet. Thanks. Link to comment Share on other sites More sharing options...
alex_developer Posted November 4 Share Posted November 4 Unfortunately, PrestaShop does not have a standard parameter in the admin panel that allows you to change the order of calculating taxes and discounts. That is, this logic is hard-coded in internal classes. Taxes and discounts are calculated in the /classes/Cart.php file. To change the tax calculation, you need to redefine the Cart.php class and change the logic for calculating the discounted price and tax in the methods: getOrderTotal() getTaxesAverageUsed() getTotalDiscounts() Link to comment Share on other sites More sharing options...
skijump Posted November 5 Author Share Posted November 5 @alex_developer Thanks for the reply. Any chance you'd know how to code this change in the cart.php file? Link to comment Share on other sites More sharing options...
alex_developer Posted November 5 Share Posted November 5 1 hour ago, skijump said: Thanks for the reply. Any chance you'd know how to code this change in the cart.php file? Yes Link to comment Share on other sites More sharing options...
skijump Posted November 8 Author Share Posted November 8 @alex_developer Great. Something you could share with the community? Thanks Link to comment Share on other sites More sharing options...
alex_developer Posted November 8 Share Posted November 8 3 hours ago, skijump said: Great. Something you could share with the community? Thanks @skijump I know how this can be implemented, and I have described my vision for implementation above. Unfortunately, I do not have any ready-made working code. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now