WC_Abstract_Order::get_total_discount()
Gets the total discount amount.
Метод класса: WC_Abstract_Order{}
Хуки из метода
Возвращает
float
.
Использование
$WC_Abstract_Order = new WC_Abstract_Order(); $WC_Abstract_Order->get_total_discount( $ex_tax );
- $ex_tax(true|false)
- Show discount excl any tax.
По умолчанию: true
Код WC_Abstract_Order::get_total_discount() WC Abstract Order::get total discount WC 9.7.1
public function get_total_discount( $ex_tax = true ) { if ( $ex_tax ) { $total_discount = (float) $this->get_discount_total(); } else { $total_discount = (float) $this->get_discount_total() + (float) $this->get_discount_tax(); } return apply_filters( 'woocommerce_order_get_total_discount', NumberUtil::round( $total_discount, WC_ROUNDING_PRECISION ), $this ); }