Filter sold individually quantity for add to cart requests.
1, $request['quantity'], $product_id, $variation_id, $request['cart_item_data']
Sortie :
@param integer $sold_individually_quantity Defaults to 1. @param integer $quantity Quantity of the item added to the cart. @param integer $product_id ID of the product added to the cart. @param integer $variation_id Variation ID of the product added to the cart. @param array $cart_item_data Array of other cart item data. @return integer
// Modifier la valeur avec le filtre 'woocommerce_add_to_cart_sold_individually_quantity'
add_filter('woocommerce_add_to_cart_sold_individually_quantity', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre(1) {
// Modifier la valeur
return 1;
}
Chargement des actualités...