batman42ca Posted March 17, 2014 Share Posted March 17, 2014 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. 1 Link to comment Share on other sites More sharing options...
Enrique Gómez Posted March 17, 2014 Share Posted March 17, 2014 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 More sharing options...
batman42ca Posted March 17, 2014 Author Share Posted March 17, 2014 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 More sharing options...
Enrique Gómez Posted March 18, 2014 Share Posted March 18, 2014 Your discount should be 1-(1/1.1) =0.091 = 9.1% product cost $100 9.1% discount =$9.1 subtotal =$90.9 10% tax =$9.1 total =$100 Link to comment Share on other sites More sharing options...
batman42ca Posted March 18, 2014 Author Share Posted March 18, 2014 (edited) 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 March 24, 2014 by batman42ca (see edit history) 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