Skip to content

Instantly share code, notes, and snippets.

@fylgjur
Forked from mikejolley/gist:5568708
Last active February 19, 2021 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fylgjur/fb32f8549dec158c754d0ac2c4283fac to your computer and use it in GitHub Desktop.
Save fylgjur/fb32f8549dec158c754d0ac2c4283fac to your computer and use it in GitHub Desktop.
Apply tax based on subtotal
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;
}
@vipfanauctions
Copy link

What would we add or change to have this rule charge VAT on UK orders only?

@luci-us
Copy link

luci-us commented Feb 19, 2021

I'm on the same quest... I've checked this https://gist.github.com/iMazed/a1373480a9a99933616e85bb95b13537#file-brexit-tax
but it didn't work, don't know why. Tried to reach out to IMazed but had no answer. Can you check it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment