woocommerce_pre_remove_cart_item_from_session

FILTER woocommerce\includes\class-wc-cart-session.php (ligne 160) github
Allow 3rd parties to validate this item before it's added to cart and add their own notices.

Paramètres

Entrée :
false, $key, $values, $product
Sortie :
@param bool       $remove_cart_item_from_session If true, the item will not be added to the cart. Default: false.
@param string     $key Cart item key.
@param array      $values Cart item values e.g. quantity and product_id.
@param WC_Product $product The product being added to the cart.

Utilisation

// Modifier la valeur avec le filtre 'woocommerce_pre_remove_cart_item_from_session'
add_filter('woocommerce_pre_remove_cart_item_from_session', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre(false) {
    // Modifier la valeur
    return false;
}

Actualités

Chargement des actualités...