Skip to content

Instantly share code, notes, and snippets.

@kilbot
Last active May 18, 2022 17:38
Show Gist options
  • Save kilbot/3ed175b4e4e0d6c30747c9eda10cc346 to your computer and use it in GitHub Desktop.
Save kilbot/3ed175b4e4e0d6c30747c9eda10cc346 to your computer and use it in GitHub Desktop.
Adding a dummy email address at customer creation
<?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