WC_Legacy_Cart::get_discounts_before_tax() public WC 1.0
Устарела с версии 2.3.0 Order discounts (after tax) removed in 2.3 so multiple methods for discounts are no longer required.. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.╳
Gets the total (product) discount amount - these are applied before tax.
{} Это метод класса: WC_Legacy_Cart{}
Хуки из метода
Возвращает
Разное. formatted price or false if there are none.
Использование
$WC_Legacy_Cart = new WC_Legacy_Cart(); $WC_Legacy_Cart->get_discounts_before_tax();
Список изменений
Устарела с 2.3.0 | Order discounts (after tax) removed in 2.3 so multiple methods for discounts are no longer required. |
Код WC_Legacy_Cart::get_discounts_before_tax() WC Legacy Cart::get discounts before tax WC 5.0.0
public function get_discounts_before_tax() {
wc_deprecated_function( 'get_discounts_before_tax', '2.3', 'get_total_discount' );
if ( $this->get_cart_discount_total() ) {
$discounts_before_tax = wc_price( $this->get_cart_discount_total() );
} else {
$discounts_before_tax = false;
}
return apply_filters( 'woocommerce_cart_discounts_before_tax', $discounts_before_tax, $this );
}