WC_Discounts::set_items()publicWC 3.2.3

Set items directly. Used by WC_Cart_Totals.

Method of the class: WC_Discounts{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Discounts = new WC_Discounts();
$WC_Discounts->set_items( $items );
$items(array) (required)
Items to set.

Changelog

Since 3.2.3 Introduced.

WC_Discounts::set_items() code WC 8.6.1

public function set_items( $items ) {
	$this->items     = $items;
	$this->discounts = array();
	uasort( $this->items, array( $this, 'sort_by_price' ) );
}