Created
November 4, 2020 17:26
-
-
Save jessepearson/291c0468876e680b6360fb6b84d72c79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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