Exclude Tax From Specific Options


In the UK we don't charge tax on products intended for children under 14. My client sells kids clothing. They'd like to be able to be able to exclude the under 14s size options from adding tax.

I've created an addon which adds a box to the product options for "exclude tax: yes/no" and adds a column to the cscart_product_option_variants table called "ex_tax" which can be Y or N.

My question is, how can I have the cart exclude the product from the tax calculation when a customer selects a product option where this box is set to "yes"?

I'm currently learning to program addons so I'd really appreciate someone showing me how to program this myself rather than pointing me in the direction of an already created addon.

Any advice would be appreciated.


Hello, looks very complex task. Please have a look at the fn_calculate_taxes function in app/functions/fn.cart.php file. Most probably you have to use 'calculate_taxes_post' hook.

Thank you.

I've had a look at that function and the hook and I think I might be in over my head. looks very complicated indeed.

Do you know of any addon already made which will do this? I'm sure I found one the other day but can't seem to find it again.

Unfortunately I do not know such addons. However we can develop it for you. Please contact us if you are interested in it.

Thank you.