• Resolved dragoscristian

    (@dragoscristian)


    Hello!

    I have been battling with the whole tax exemption in EU in WooCommerce for quite a while.

    What is the behavior I need:
    If customer from outside EU – apply no tax (this works great)
    If customer from inside EU but no VAT number – apply respective tax (this works great using itemized tax display at checkout)
    If customer from inside EU with VAT number, I use a plugin VAT Number checker that sets for that order is_vat_exempt() flag or however it’s called, BUT that means it will not show up at checkout, after checkout when reviewing the order, or in the confirmation email.

    I did find these filters:

    add_filter( 'woocommerce_cart_hide_zero_taxes', '__return_false' );
    add_filter( 'woocommerce_order_hide_zero_taxes', '__return_false' );

    But in cart they do not work when showing itemized tax (which I need, for the correct VAT name in every country). Plus, as mentioned above, the tax field is not shown at any point.

    One thing I can do, is show this during checkout using this filter:

    add_filter('woocommerce_cart_tax_totals', function($tax_totals) {
      if(empty( $tax_totals ) && wc()->customer->is_vat_exempt()) {
        $tax_totals['zero-rated'] = (object) array(
          'label' => 'VAT Exempt (reverse-charge)',
          'amount' => 0,
          'formatted_amount' => woocommerce_price(0),
          'name' => '0% VAT',
          'is_compound' => false,
        );
      }

    But this solution only works during checkout…at the review page or in the confirmation email is gone, and because I need PDF invoices, it’s not there either.

    MY PROPOSED SOLUTION:
    I believe that all these issues could be resolved with a simple filter (that I cannot write). What if there would be a filter that looks if the order is_vat_exempt() and automatically transfers the vat rate to “Zero Rate”. I can define the list of countries and what text I need to write (reverse charge etc.) in the tax tab in WooCommerce and if it will show even 0% tax…then ALL these issues should be gone.

    It should appear at checkout, during the review phase, on the confirmation e-mail and even on any PDF invoice, because it is a tax field.

    Is this possible? Could anyone help me with this perhaps? I don’t believe it is a complicated code…

    Thank you!
    Christian

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Ross V. a11n

    (@rossviviano)

    Automattic Happiness Engineer

    Hi there,

    This is a fairly complex development topic, so I’m going to leave it open for a bit to see if anyone is able to jump in to help you out.

    I can also recommend the following places for more development-oriented questions:

    WooCommerce Slack Community: https://woocommerce.com/community-slack/
    Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/

    Best,

    Ross

    Plugin Support Ross V. a11n

    (@rossviviano)

    Automattic Happiness Engineer

    Hi again,

    It doesn’t look like anyone was able to hop in here, so I’m going to close this thread. Moving forward, getting in touch with one of the groups I previously mentioned is best.

    Ross

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Tax exempt linked to tax rates’ is closed to new replies.