public function setDiscountOnItem(CartItem $item)
    {
        $this->appliedToCart = false;
        $item->code = $this->code;
        $item->coupon = $this;
    }
public function setDiscountOnItem(CartItem $item)
    {
        $this->appliedToCart = false;
        $item->code = $this->code;
        $item->coupon = $this;
    }
public function setDiscountOnItem ( CartItem $ item ) { $ this -> appliedToCart = false ; $ item -> code = $ this -> code ; $ item -> coupon = $ this ; }
Sets a discount to an item with what code was used and the discount amount.

@param CartItem $item
Sets a discount to an item with what code was used and the discount amount .