Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jessepearson/291c0468876e680b6360fb6b84d72c79 to your computer and use it in GitHub Desktop.
Save jessepearson/291c0468876e680b6360fb6b84d72c79 to your computer and use it in GitHub Desktop.
<?php // do not copy this line
add_action( 'woocommerce_checkout_update_order_review', 'set_vat_exempt_for_customer_20201104', 10 );
function set_vat_exempt_for_customer_20201104( $post_data ) {
if ( isset( $_POST['country'] )
&& isset( $_POST['state'] )
&& 'ES' === $_POST['country']
&& 'TF' === $_POST['state'] ) {
WC()->customer->set_props(
array(
'is_vat_exempt' => true,
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment