Allow items to be sent directly to the discounts class
This commit is contained in:
parent
130d719d90
commit
624c1a9516
|
@ -52,6 +52,18 @@ class WC_Discounts {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set items directly. Used by WC_Cart_Totals.
|
||||
*
|
||||
* @since 3.2.3
|
||||
* @param array $items Items to set.
|
||||
*/
|
||||
public function set_items( $items ) {
|
||||
$this->items = $items;
|
||||
$this->discounts = array();
|
||||
uasort( $this->items, array( $this, 'sort_by_price' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalise cart items which will be discounted.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue