• Resolved sumight

    (@sumight)


    How can I use different tax rate for the same country according an order amount.

    For example:
    Now all goods send to European Union country from out of EU need to apply different VAT for the countries by the sellers when order amount is between Euro 0 – 150.
    I need to set VAT 19% for Germany when order amount is Euro 0 – 150. Then when order amount is more than Euro 150 the VAT should be set to 0%

Viewing 4 replies - 1 through 4 (of 4 total)
  • Mirko P.

    (@rainfallnixfig)

    Hi @sumight,

    You can apply a specific tax rate depending on the order subtotal. For this, you can use the below code snippet from Learn Woo.

    https://bit.ly/3k7ndko

    Through this snippet, you can specify which tax rate to be applied when the order subtotal is equal to or less than €150.

    Cheers.

    Thread Starter sumight

    (@sumight)

    Hi @rainfallnixfig

    add_filter( 'woocommerce_product_tax_class', 'big_apple_get_tax_class', 1, 2 );
    function big_apple_get_tax_class( $tax_class, $product ) {
    if ( WC()->cart->subtotal > 150)
    $tax_class = 'Zero rate';
    return $tax_class;
    }

    Thank you for patient. But it seems not work now. The tax still there When order amount is more than 150.

    Also I get an error in the product page of admin as below:
    Notice: Trying to get property 'subtotal' of non-object in ...\WWW\wp-content\themes\theme-child\functions.php on line 119

    An other question is I need add the country condition to avoid this snippet use for all countries.

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    Thanks for getting back.

    Sorry to hear that it’s not working, but since we’re not developers here you’ll want to try other channels and visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack.

    We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Thanks.

    Thread Starter sumight

    (@sumight)

    @rainfallnixfig Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Use different tax rate for the same country according an order amount’ is closed to new replies.