• Resolved matelina

    (@matelina)


    Hello,

    I am a US-based seller with a large UK customer base. I am trying to make my site brexit-compliant so that I can collect the VAT taxes that I’m required to do as of 2021.

    1. I used this Woo tutorial, which has a code snippet for applying taxes based on the cart subtotal. I am trying to make the tax only apply for orders under £135. However, it does not seem to work. The tax is applied regardless of the cart subtotal. Has anyone successfully implemented this, or something else to the same end?
    https://docs.woocommerce.com/document/setting-up-taxes-in-woocommerce/#configuring-special-tax-setups

    2. Do I need to configure something related to multi-currency in order for this code to use £135 rather than $135? Set up a currency-switcher based on user’s IP or something?

    TIA, this is beyond my usual skillset.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @matelina,

    That is an interesting situation indeed. It could very well be currency related too.

    How do you go about handling the two currencies? Do you convert the currency from one to the other before submitting to the payment gateway or do you send orders through in both currencies to the payment gateway?

    Knowing that will help find a solution.

    Thanks!

    Hi @matelina

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Thread Starter matelina

    (@matelina)

    Ah bummer! Definitely not resolved, just have been too busy to deal with this.

    I agree that there will need to be some currency settings implemented to work the subtotal threshold in pounds rather than dollars, but if the code worked, you’d think it would be working for orders above/below $135 USD. So I think my initial problem is that the code snippet doesn’t seem to work.

    Considering this is such a big change to e-commerce I’m really surprised there hasn’t been more documentation for this.

    Hey @matelina,

    I totally understand that this is only one of many things going on.

    Is this the snippet you’re working with?

    
    add_filter( 'woocommerce_product_get_tax_class', 'big_apple_get_tax_class', 1, 2 );
    
    function big_apple_get_tax_class( $tax_class, $product ) {
    	if ( WC()->cart->subtotal <= 110 )
    		$tax_class = 'Zero Rate';
    
    	return $tax_class;
    }
    

    If so that’s totally built around the currency set in the WooCommerce settings. If that’s set to US dollars, then it would apply the “Zero Rate” tax class when the cart subtotal is less than or equal to 110 USD.

    It is possible to use multiple currencies with WooComomerce. Typically that’s handled with a plugin like Multi-Currency. You would need to check with the developer to see how they handle currencies in the cart. Then you could modify the snippet above so that it works with different currencies.

    Thread Starter matelina

    (@matelina)

    Yes, that’s the snippet. I changed the tax class to “Standard Rate”, as that’s where I have the VAT tax set up. And the threshold to 135. However, it doesn’t work. I know I’ll have to configure some sort of multi-currency to make it work in GBP, but it should be working now in USD right? Currently the tax is applied always regardless of the subtotal.

    • This reply was modified 3 years, 7 months ago by matelina.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Tax Based on Subtotal’ is closed to new replies.