WC_Discounts::set_items
Set items directly. Used by WC_Cart_Totals.
Method of the class: WC_Discounts{}
No Hooks.
Returns
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() WC Discounts::set items code WC 10.5.0
public function set_items( $items ) {
$this->items = $items;
$this->discounts = array();
uasort( $this->items, array( $this, 'sort_by_price' ) );
}