WC_Abstract_Order::get_total_discount( bool $ex_tax = true )
Gets the total discount amount.
Description Description
Parameters Parameters
- $ex_tax
-
(Optional) Show discount excl any tax.
Default value: true
Return Return
(float)
Source Source
File: includes/abstracts/abstract-wc-order.php
public function get_total_discount( $ex_tax = true ) { if ( $ex_tax ) { $total_discount = $this->get_discount_total(); } else { $total_discount = $this->get_discount_total() + $this->get_discount_tax(); } return apply_filters( 'woocommerce_order_get_total_discount', round( $total_discount, WC_ROUNDING_PRECISION ), $this ); }