Post by webs_bd » Fri May 17, 2019 11:08 pm

Version 1.5.6.1

Currently our store shows (for example) a 10% coupon code which is deducted correctly from the goods total; but subsequently after that the VAT is valued from the goods total also, not from the goods total minus the coupon discount, which is what we want. I have changed 'sort order' to many combinations but cannot get the result required. Can anyone help?

Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk


New member

Posts

Joined
Sat Nov 09, 2013 8:29 pm

Post by johnp » Fri May 17, 2019 11:33 pm


Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD 2.6.1 lover, user and geek.
Fast Service for Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
https://www.asandwhenbusinessservices.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by Johnathan » Sat May 18, 2019 9:42 pm

Just for reference, Super Coupons can do this, since it bases its calculation on the sub-total without tax by default. However, I think there's an easy edit to get the built-in coupon system to do this, since you just have to skip it applying discounts to tax. Try this edit and see if it works:

Code: Select all

IN:
/catalog/model/total/coupon.php

REPLACE:
if ($product['tax_class_id']) {

WITH:
if (false) {

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by webs_bd » Mon May 20, 2019 5:58 pm

Thanks for the reply.
My problem is slightly different. The coupon amount is correct but the VAT is calculated on the total before the coupon, so the total is incorrect - see attachment.

Attachments

Screenshot 2019-05-20 at 10.32.13.png

Screenshot 2019-05-20 at 10.32.13.png (17.56 KiB) Viewed 343 times


Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk


New member

Posts

Joined
Sat Nov 09, 2013 8:29 pm

Post by webs_bd » Mon May 20, 2019 7:57 pm

Johnathan wrote:
Sat May 18, 2019 9:42 pm
Just for reference, Super Coupons can do this, since it bases its calculation on the sub-total without tax by default. However, I think there's an easy edit to get the built-in coupon system to do this, since you just have to skip it applying discounts to tax. Try this edit and see if it works:

Code: Select all

IN:
/catalog/model/total/coupon.php

REPLACE:
if ($product['tax_class_id']) {

WITH:
if (false) {
Thank you for the suggestion. No this did not fix it. In fact investigating this further the coupon does not get deducted at all until it gets taken off the grand total, irrespective of what order the 'order totals' are in.

Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk


New member

Posts

Joined
Sat Nov 09, 2013 8:29 pm

Post by Johnathan » Mon May 20, 2019 9:38 pm

Coupons should affect the tax if the products in the cart have Tax Classes on them. The edit I gave you would reverse that, but if the default behavior isn't working, then something's wrong in your installation. The order of the line items does not matter in this case --- the Coupon line item is coded to look at the discount, and deduct it's portion from the taxes.

I'm not sure why it's not working for you. You could use Super Coupons which is its own system, and would work fine with Taxes and how it calculates its discount. If you don't want to get an extension, hopefully someone will post here with some ideas for why it's not working.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: Bing [Bot] and 6 guests