WC_Abstract_Order::get_total_discount()publicWC 1.0

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 8.7.0

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 );
}