woocommerce_created_customer

ACTION woocommerce\includes\wc-user-functions.php (ligne 198) github
Fires after a customer account has been registered. This hook fires after customer accounts are created and passes the customer data.
traduction française
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.

Paramètres

Entrée :
$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.

Utilisation

Action après création d'un nouveau client

Exécuter du code une fois le compte client créé

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
}

Actualités

Chargement des actualités...