WC_Abstract_Order::get_discount_to_display()
Get the discount amount (formatted).
Method of the class: WC_Abstract_Order{}
Hooks from the method
Return
String
.
Usage
$WC_Abstract_Order = new WC_Abstract_Order(); $WC_Abstract_Order->get_discount_to_display( $tax_display );
- $tax_display(string)
- Excl or incl tax display mode.
Default: ''
Changelog
Since 2.3.0 | Introduced. |
WC_Abstract_Order::get_discount_to_display() WC Abstract Order::get discount to display code WC 9.3.3
public function get_discount_to_display( $tax_display = '' ) { $tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' ); /** * Filter the discount amount to display. * * @since 2.7.0. */ return apply_filters( 'woocommerce_order_discount_to_display', wc_price( $this->get_total_discount( 'excl' === $tax_display ), array( 'currency' => $this->get_currency() ) ), $this ); }