woocommerce_coupon_get_discount_amount

FILTER woocommerce\includes\class-wc-discounts.php (ligne 392) github
Apply percent discount to items and return an array of discounts granted.

Paramètres

Entrée :
wc_remove_number_precision( $discount
Sortie :
@param  WC_Coupon $coupon Coupon object. Passed through filters.
@param  array     $items_to_apply Array of items to apply the coupon to.
@return int Total discounted.

Utilisation

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

function ma_fonction_filtre(wc_remove_number_precision( $discount) {
    // Modifier la valeur
    return wc_remove_number_precision( $discount;
}

Actualités

Chargement des actualités...