WordPress at a glance
function is not described

WC_Legacy_Cart::get_discounts_before_tax() public WC 1.0

Deprecated from version 2.3.0 Order discounts (after tax) removed in 2.3 so multiple methods for discounts are no longer required.. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Gets the total (product) discount amount - these are applied before tax.

{} It's a method of the class: WC_Legacy_Cart{}

Return

Mixed. formatted price or false if there are none.

Usage

$WC_Legacy_Cart = new WC_Legacy_Cart();
$WC_Legacy_Cart->get_discounts_before_tax();

Changelog

Deprecated Since 2.3.0 Order discounts (after tax) removed in 2.3 so multiple methods for discounts are no longer required.

Code of WC_Legacy_Cart::get_discounts_before_tax() WC 5.0.0

<?php
public function get_discounts_before_tax() {
	wc_deprecated_function( 'get_discounts_before_tax', '2.3', 'get_total_discount' );
	if ( $this->get_cart_discount_total() ) {
		$discounts_before_tax = wc_price( $this->get_cart_discount_total() );
	} else {
		$discounts_before_tax = false;
	}
	return apply_filters( 'woocommerce_cart_discounts_before_tax', $discounts_before_tax, $this );
}