Support » Plugin: WooCommerce » Price including tax doesn’t play nice with EU VAT Number Plugin

  • Hi!

    I’m trying to use the Prices including tax – Experimental Behavior in my shop, because I want to sell to every country with the same price.

    add_filters( 'woocommerce_adjust_non_base_location_prices', '__return_false' )

    I also bought the EU VAT Number Plugin to remove the VAT for companies in the EU.

    BUT… there’s one small problem:

    Whenever I activate the experimental behavior and the plugin, something strange happens at checkout when someone enters a valid VAT Number.

    The price of the product gets subtracted with the base address tax (20% in my case).
    And the subtotal and total with tax based on the entered billing country (19% in Germany) which is right. See this screenshot:

    How do I get the product price to display correctly?

    Thank you!

Viewing 1 replies (of 1 total)
  • Ok, I think we got it:

    The problem lies within abstract-wc-product.php row 869 get_price_including_tax().

    WooCommerce checks if is_vat_exempt() but doesn’t check if woocommerce_adjust_non_base_location_prices is set to false.

    Therefore it calculates the price of the product the wrong way.

    We added this code

    if ( $tax_rates !== $base_tax_rates && ! apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
    	$base_tax_amount = array_sum( WC_Tax::calc_tax( $price * $qty, $tax_rates, true ) );

    and now it works as expected.

Viewing 1 replies (of 1 total)
  • The topic ‘Price including tax doesn’t play nice with EU VAT Number Plugin’ is closed to new replies.