WC_Abstract_Order::get_total_discount
Gets the total discount amount.
Method of the class: WC_Abstract_Order{}
Hooks from the method
Returns
float.
Usage
$WC_Abstract_Order = new WC_Abstract_Order(); $WC_Abstract_Order->get_total_discount( $ex_tax );
- $ex_tax(true|false)
- Show discount excl any tax.
Default:true
WC_Abstract_Order::get_total_discount() WC Abstract Order::get total discount code WC 10.6.2
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 );
}