0
votes

The problem is: If we sell a ticket to our customer, we pay the tax not where the customer lives and not where the company of the shop is located. We pay the tax, where the event is held.

We can use a workaround where we can define a tax class for each country, with the rate. But this is very ugly.

I would like to develope something where I can set the country for the events and WooCommerce will use this country as a tax base, just for this product.

My problem is, that I don't know which filter I should apply. I found some, but the filter don't give the product object or the product id as parameter.

For example: https://docs.woocommerce.com/wc-apidocs/source-class-WC_Checkout.html#468

Does someone have an idea?

1
Hey, did you find out how to do it?marcelocbf
Unfortunately not yet. Still haven't managed to try something around myself.mcswizz

1 Answers

1
votes

thanks for getting back to me. That's the "hack" I implemented but it solved for me

I used the filter woocommerce_price_ex_tax_amount (there is also, woocommerce_price_inc_tax_amount) for inclusive tax calculation.

It receives $tax_amount (already calculated), $key, $rate, $price.

You can setup a fictitious tax rate for every ticket and modify it programatically. As you'll receive the price as well, you can recalculate the rate base on it and return it.

Hope it helps,