WC_Discounts::get_discounts_by_coupon() public WC 3.2.0
Get all discount totals per coupon.
{} Это метод класса: WC_Discounts{}
Хуков нет.
Возвращает
Массив.
Использование
$WC_Discounts = new WC_Discounts(); $WC_Discounts->get_discounts_by_coupon( $in_cents );
- $in_cents(true/false)
- Should the totals be returned in cents, or without precision.
Список изменений
С версии 3.2.0 | Введена. |
Код WC_Discounts::get_discounts_by_coupon() WC Discounts::get discounts by coupon WC 5.0.0
public function get_discounts_by_coupon( $in_cents = false ) {
$coupon_discount_totals = array_map( 'array_sum', $this->discounts );
return $in_cents ? $coupon_discount_totals : wc_remove_number_precision_deep( $coupon_discount_totals );
}