add_action( 'woocommerce_checkout_update_order_review', 'isktaxexempt_checkout_based_on_state', 10, 1 ); function isktaxexempt_checkout_based_on_state( $post_data ) { WC()->customer->set_is_vat_exempt( false ); parse_str( $post_data, $output ); $statecodes =array( 'PA','MN','VT','OR','MT','AK','NH' ); if ( in_array($output['billing_state'], $statecodes) ) WC()->customer->set_is_vat_exempt( true ); WC()->cart->calculate_shipping(); return; }