Post by nbdevelopdreece » Wed Jan 08, 2020 9:23 pm

Hello everyone! :D

TL;DR: Change VAT for items in a specific category.

There is the need for a change in VAT in the cart/checkout page. If the product only contains products from a specific category, then change/reduce VAT to a fixed value.

Example 1: if cart has 4 products from category "helmets", change VAT to 5%.
Example 2: if cart has 2 products from category "helmets" and 1 product from category "gloves", leave VAT unchanged.
Example 3: if cart has 1 product from category "helmets", change VAT to 5%.
Example 4: if cart has 1 product from category "gloves", leave VAT unchanged.

Is it possible? Any ideas? Could anyone point me to the right direction? Thank you in advance.


Posts

Joined
Tue Oct 08, 2019 10:42 pm

Post by uksitebuilder » Wed Jan 08, 2020 10:18 pm

That makes little sense.

Products are taxable at a set rate, based on whether they are for import or export, not determined by which category they belong to.

One thing you do not want to do is fall foul of the taxman.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by by mona » Wed Jan 08, 2020 10:53 pm

ditto above ..

tax is product based, so there is no reason why you are proposing a complicated structure, unless you are asking for a quick way to update all the tax in a category rather than do it by product.

This tutorial explains how to set up your tax
https://code.tutsplus.com/tutorials/und ... -cms-25106

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by paulfeakins » Thu Jan 09, 2020 6:47 pm

nbdevelopdreece wrote:
Wed Jan 08, 2020 9:23 pm
Any ideas?
No ideas, only questions: What are you doing and why? :laugh:

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by nbdevelopdreece » Mon Feb 17, 2020 6:51 pm

paulfeakins wrote:
Thu Jan 09, 2020 6:47 pm
nbdevelopdreece wrote:
Wed Jan 08, 2020 9:23 pm
Any ideas?
No ideas, only questions: What are you doing and why? :laugh:
I want to change the tax rate based on category because of a new law stating that helmets, children car seats and other safety items must be sold with a lower VAT.


Posts

Joined
Tue Oct 08, 2019 10:42 pm

Post by nbdevelopdreece » Mon Feb 17, 2020 6:54 pm

Replying to the other comments above,
Thank you for your replies.

I ended up changing the Tax class in the database of each product (product table) based on the category (product_category table) it is in (after creating a new tax class).


Posts

Joined
Tue Oct 08, 2019 10:42 pm

Post by mpikkis » Thu May 09, 2024 9:13 pm

Hi, i am really interested for this also. could you elaborate how u did it ?
Thanks

Newbie

Posts

Joined
Mon Nov 06, 2017 5:09 pm

Post by paulfeakins » Thu May 09, 2024 10:02 pm

mpikkis wrote:
Thu May 09, 2024 9:13 pm
Hi, i am really interested for this also. could you elaborate how u did it ?
Thanks
I think this is pretty clear:
"I ended up changing the Tax class in the database of each product (product table) based on the category (product_category table) it is in (after creating a new tax class)."

So they probably wrote an SQL query that updated the tax class of each product that was in a certain category.

Writing such a query wouldn't be too tricky.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by mpikkis » Thu May 16, 2024 6:42 pm

Oh right, my mistake, i got it wrong. I wanted to change VAT for specific category, but for specific customer group ONLY

Newbie

Posts

Joined
Mon Nov 06, 2017 5:09 pm

Post by paulfeakins » Thu May 16, 2024 9:32 pm

mpikkis wrote:
Thu May 16, 2024 6:42 pm
Oh right, my mistake, i got it wrong. I wanted to change VAT for specific category, but for specific customer group ONLY
Not possible without an extension because tax classes are based on products and geo zones.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by ADD Creative » Thu May 16, 2024 10:04 pm

mpikkis wrote:
Thu May 16, 2024 6:42 pm
Oh right, my mistake, i got it wrong. I wanted to change VAT for specific category, but for specific customer group ONLY
You can edit the Tax Rates and select which customer groups they apply to.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by paulfeakins » Thu May 16, 2024 10:51 pm

ADD Creative wrote:
Thu May 16, 2024 10:04 pm
mpikkis wrote:
Thu May 16, 2024 6:42 pm
Oh right, my mistake, i got it wrong. I wanted to change VAT for specific category, but for specific customer group ONLY
You can edit the Tax Rates and select which customer groups they apply to.
Are you sure? I can't see where that is in the admin?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by paulfeakins » Thu May 16, 2024 10:57 pm

Ah I've had another look so in System > Localisation > Taxes > Tax Rates > Edit you can untick a tax rate for a Customer Group.

So it can be done without an extension, that's cool.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: Google [Bot] and 63 guests