Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Last active January 5, 2021 18:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save mikejolley/5568708 to your computer and use it in GitHub Desktop.
Save mikejolley/5568708 to your computer and use it in GitHub Desktop.
Apply tax based on subtotal
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 <= 110 )
$tax_class = 'Zero Rate';
return $tax_class;
}
@fylgjur
Copy link

fylgjur commented Jan 5, 2021

Hi! I have updated the code in my fork: https://gist.github.com/fylgjur/fb32f8549dec158c754d0ac2c4283fac
To include the updated filter woocommerce_product_get_tax_class

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