How to remove VAT when currency is change to other
-
Hello earlier we are using below code to remove Vat when customer is from outside of UK, now we are using free version of this plugin into our site, and we want to make below code to work with when someone change currency to another for i.e. USD, then we want to remove VAT. Can you advise on this, any hook/action/filter is available for this?
function extempt_vat_for_non_eu_firms($post_data) { WC()->customer->set_is_vat_exempt(false); parse_str($post_data, $output); $countries_without_vat = array('US', 'AU', 'JE', 'AD', 'AL', 'AT', 'AX', 'BA', 'BE', 'BG', 'BY', 'CH', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FO', 'FR', 'GG', 'GI', 'GR', 'HR', 'HU', 'IE', 'IM', 'IS', 'IT', 'JE', 'LI', 'LT', 'LU', 'LV', 'MC', 'MD', 'ME', 'MK', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'RS', 'RU', 'SE', 'SI', 'SJ', 'SK', 'SM', 'TR', 'UA', 'VA', 'CA'); if ($output['ship_to_different_address'] == 1) { if (in_array($output['shipping_country'], $countries_without_vat)) { WC()->customer->set_is_vat_exempt(true); } } else { if (in_array($output['billing_country'], $countries_without_vat)) { WC()->customer->set_is_vat_exempt(true); } } } add_action('woocommerce_checkout_update_order_review', 'extempt_vat_for_non_eu_firms');
The page I need help with: [log in to see the link]
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘How to remove VAT when currency is change to other’ is closed to new replies.