WC_Abstract_Order::add_order_item_totals_discount_row( array $total_rows, string $tax_display )

Add total row for discounts.


Description Description


Parameters Parameters

$total_rows

(Required) Reference to total rows array.

$tax_display

(Required) Excl or incl tax display mode.


Top ↑

Source Source

File: includes/abstracts/abstract-wc-order.php

	protected function add_order_item_totals_discount_row( &$total_rows, $tax_display ) {
		if ( $this->get_total_discount() > 0 ) {
			$total_rows['discount'] = array(
				'label' => __( 'Discount:', 'woocommerce' ),
				'value' => '-' . $this->get_discount_to_display( $tax_display ),
			);
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.