woocommerce_coupon_get_discount_amount хук-фильтрWC 1.0

Send through the legacy filter, but not as cents.

Использование

add_filter( 'woocommerce_coupon_get_discount_amount', 'wp_kama_woocommerce_coupon_get_discount_amount_filter', 10, 4 );

/**
 * Function for `woocommerce_coupon_get_discount_amount` filter-hook.
 * 
 * @param  $wc_remove_number_precision 
 * @param  $object                     
 * @param  $false                      
 * @param  $coupon                     
 *
 * @return 
 */
function wp_kama_woocommerce_coupon_get_discount_amount_filter( $wc_remove_number_precision, $object, $false, $coupon ){

	// filter...
	return $wc_remove_number_precision;
}
$wc_remove_number_precision
-
$object
-
$false
-
$coupon
-

Где вызывается хук

WC_Discounts::apply_coupon_percent()
woocommerce_coupon_get_discount_amount
WC_Discounts::apply_coupon_fixed_product()
woocommerce_coupon_get_discount_amount
WC_Coupon::get_discount_amount()
woocommerce_coupon_get_discount_amount
woocommerce/includes/class-wc-discounts.php 376
$filtered_discount = wc_add_number_precision( apply_filters( 'woocommerce_coupon_get_discount_amount', wc_remove_number_precision( $discount ), wc_remove_number_precision( $price_to_discount ), $item->object, false, $coupon ) );
woocommerce/includes/class-wc-discounts.php 441
$discount = wc_add_number_precision( apply_filters( 'woocommerce_coupon_get_discount_amount', wc_remove_number_precision( $discount ), wc_remove_number_precision( $price_to_discount ), $item->object, false, $coupon ) );
woocommerce/includes/class-wc-coupon.php 465-472
return apply_filters(
	'woocommerce_coupon_get_discount_amount',
	NumberUtil::round( min( $discount, $discounting_amount ), wc_get_rounding_precision() ),
	$discounting_amount,
	$cart_item,
	$single,
	$this
);

Где используется хук в WooCommerce

Использование не найдено.