Remove a cart item.
Supprimer un article du panier.
$cart_item_key, $this
Sortie :
@param string $cart_item_key Cart item key to remove from the cart. @return bool
// Action lors de la suppression d'un article du panier
add_action('woocommerce_remove_cart_item', 'tracking_suppression_panier', 10, 2);
function tracking_suppression_panier($cart_item_key, $cart) {
$cart_item = $cart->get_cart_item($cart_item_key);
$product = $cart_item['data'];
// Analytics: produit retiré
// Proposer une alternative
// Logger pour analyse d'abandon
error_log('Produit retiré: ' . $product->get_name());
}
Chargement des actualités...