Fires after a customer account has been registered. This hook fires after customer accounts are created and passes the customer data.
Se déclenche après l'enregistrement d'un compte client. Ce crochet se déclenche après la création d'un compte client et transmet les données du client.
$customer_id, $new_customer_data, $password_generated
Sortie :
@param integer $customer_id New customer (user) ID. @param array $new_customer_data Array of customer (user) data. @param string $password_generated The generated password for the account.
// Action après création d'un client
add_action('woocommerce_created_customer', 'nouveau_client_cree', 10, 3);
function nouveau_client_cree($customer_id, $new_customer_data, $password_generated) {
// Sauvegarder le téléphone
if (isset($_POST['billing_phone'])) {
update_user_meta($customer_id, 'billing_phone', sanitize_text_field($_POST['billing_phone']));
}
// Envoyer à un CRM
// Ajouter à une liste email
// Logger pour statistiques
}
Chargement des actualités...