woocommerce_order_applied_coupon

ACTION woocommerce\includes\abstracts\abstract-wc-order.php (ligne 1328) github
Action to signal that a coupon has been applied to an order.

Paramètres

Entrée :
$coupon, $this
Sortie :
@param  WC_Coupon $coupon The applied coupon object.
@param  WC_Order  $order  The current order object.

Utilisation

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

function ma_fonction_personnalisee($coupon, $this) {
    // Votre code ici
    error_log('Hook woocommerce_order_applied_coupon déclenché');
}

Actualités

Chargement des actualités...