woocommerce_guest_session_to_user_id

ACTION woocommerce\includes\class-wc-session-handler.php (ligne 243) github
Fires after a customer has logged in, and their guest session id has been deleted with its data migrated to a customer id. This hook gives extensions the chance to connect the old session id to the customer id, if the key is being used externally.

Paramètres

Entrée :
$guest_session_id, $this->_customer_id
Sortie :
@param string $guest_session_id The former session ID, as generated by `::generate_customer_id()`.
@param string $user_session_id The Customer ID that the former session was converted to.

Utilisation

// Ajouter une fonction au hook action 'woocommerce_guest_session_to_user_id'
add_action('woocommerce_guest_session_to_user_id', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($guest_session_id, $this->_customer_id) {
    // Votre code ici
    error_log('Hook woocommerce_guest_session_to_user_id déclenché');
}

Actualités

Chargement des actualités...