Skip to content

Instantly share code, notes, and snippets.

View fylgjur's full-sized avatar

Victoria fylgjur

View GitHub Profile
@fylgjur
fylgjur / WooTaxSubtotal.txt
Last active February 19, 2021 14:52 — forked from mikejolley/gist:5568708
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;
}