Last active
August 21, 2020 15:11
-
-
Save imanispatel/51aa2f6687227095ec9f5a51b3385048 to your computer and use it in GitHub Desktop.
Remove province/state code in guest 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 guest user variable for WooCommerce Wave Connector | |
* Remove province code in guest user variable. | |
* | |
* @param array $variable get variable. | |
* @param array $order_id get order id. | |
* @return array | |
*/ | |
function venus_wc_custom_guest_user_variable( $variable, $order_id ) { | |
unset( $variable['address']['provinceCode'] ); | |
if ( isset( $variable['shippingDetails']['address']['provinceCode'] ) ) { | |
unset( $variable['shippingDetails']['address']['provinceCode'] ); | |
} | |
return $variable; | |
} | |
add_action( 'venus_wc_export_guest_customer_variables', 'venus_wc_custom_guest_user_variable', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment