WordPress at Your Fingertips
function is not described

WC_Discounts::__construct() public WC 1.0

WC_Discounts Constructor.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Discounts = new WC_Discounts();
$WC_Discounts->__construct( $object );
$object(WC_Cart|WC_Order)
Cart or order object.
Default: null

Code of WC_Discounts::__construct() WC 5.6.0

public function __construct( $object = null ) {
	if ( is_a( $object, 'WC_Cart' ) ) {
		$this->set_items_from_cart( $object );
	} elseif ( is_a( $object, 'WC_Order' ) ) {
		$this->set_items_from_order( $object );
	}
}