Last active
August 21, 2020 15:10
-
-
Save imanispatel/c613842f5989960746951b24abd41a8c to your computer and use it in GitHub Desktop.
Remove province/state code in user data while send to Wave
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 | |
/** | |
* Set custom user variable for WooCommerce Wave Connector | |
* Remove province code in user variables. | |
* | |
* @param array $variable get variables. | |
* @param array $user_id get user id. | |
* @return array | |
*/ | |
function venus_wc_custom_user_variable( $variable, $user_id ) { | |
unset( $variable['address']['provinceCode'] ); | |
if ( isset( $variable['shippingDetails']['address']['provinceCode'] ) ) { | |
unset( $variable['shippingDetails']['address']['provinceCode'] ); | |
} | |
return $variable; | |
} | |
add_filter( 'venus_wc_export_customer_variable', 'venus_wc_custom_user_variable', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment