Jump to content

Cart Rule to exclude tax


batman42ca

Recommended Posts

I have a client that wants to be able to create a Cart Rule (a voucher) so that when the voucher code is entered, the contents of the shopping cart are tax free.

 

Anyone want to suggest a cost for modifying Prestashop to permit this type of cart rule (if possible in a way that will survive an update of Prestashop)? Or does anyone know of a module (free or for purchase) that would already do this?

 

I'm a PHP programmer but I don't have time to learn what I need to know about Prestashop to do the work myself.

  • Like 1
Link to comment
Share on other sites

The simplest solution would be create a voucher with the percentage  to nullify the tax..

 

For example I have 21% VAT then 1-(1/1.21)=0.1736

 

If my client purchases are 12.5€ cart then with VAT they would be 12.5 + 0.21x12.5=15.125

 

with the discount 0.1736*15.125=2.6257

 

15.125-2.6257=12.5

 

But as far as i know the voucher does not apply to the shipping costs

Link to comment
Share on other sites

Thanks but from what I think I've seen, unless I have it configured wrong somehow (hopefully I am wrong) it actually works like this using some very easy numbers:

 

product cost = $100

10% discount = $10

subtotal = $90

10% tax = $9

total = $99

 

So I can't just use a 10% discount if my taxes are 10%. Is there some configuration option I can use to fix this?

Link to comment
Share on other sites

I had been trying to derive that equation myself but kept tripping up for some reason. It would work fine if not for rounding errors.

 

Here's a real example:

 

product cost: 599.99

tax rate = 13%

discount = 1 - 1/1.13 = 11.504424778761 ... BUT prestashop will round this to 11.5

 

subtotal = 530.99

13% tax = 69.03

total = 600.02

 

So, it's close but not the same as truly excluding the tax.

 

UPDATE: seems my client is content with the improved math so for now, I no longer need any special code for this. Thanks for the help Enrique.

Edited by batman42ca (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...