Last active
May 18, 2022 17:38
-
-
Save kilbot/3ed175b4e4e0d6c30747c9eda10cc346 to your computer and use it in GitHub Desktop.
Adding a dummy email address at customer creation
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 | |
function my_custom_create_customer_data($data){ | |
if(function_exists('is_pos') && is_pos()){ | |
$dummy_email = 'email@example.com'; // note: you would have to generate a unique email address for each user | |
$data['email'] = ! isset($data['email']) || empty($data['email']) ? $dummy_email : $data['email']; | |
}; | |
return $data; | |
} | |
add_filter('woocommerce_api_create_customer_data', 'my_custom_create_customer_data'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment