woocommerce_after_cart_item_quantity_update

ACTION woocommerce\includes\class-wc-cart.php (ligne 1421) github
Set the quantity for an item in the cart using it's key.

Paramètres

Entrée :
$cart_item_key, $quantity, $old_quantity, $this
Sortie :
@param string $cart_item_key contains the id of the cart item.
@param int    $quantity contains the quantity of the item.
@param bool   $refresh_totals whether or not to calculate totals after setting the new qty. Can be used to defer calculations if setting quantities in bulk.
@return bool

Utilisation

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

function ma_fonction_personnalisee($cart_item_key, $quantity, $old_quantity, $this) {
    // Votre code ici
    error_log('Hook woocommerce_after_cart_item_quantity_update déclenché');
}

Actualités

Chargement des actualités...