Filters the items that a coupon should be applied to. This filter allows you to modify the items that a coupon will be applied to before the discount calculations take place.
$items_to_apply, $coupon, $this
Sortie :
@param array $items_to_apply The items that the coupon will be applied to. @param WC_Coupon $coupon The coupon object. @param WC_Discounts $this The discounts instance. @return array The modified list of items that the coupon should be applied to.
// Modifier la valeur avec le filtre 'woocommerce_coupon_get_items_to_apply'
add_filter('woocommerce_coupon_get_items_to_apply', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($items_to_apply) {
// Modifier la valeur
return $items_to_apply;
}
Chargement des actualités...