public function addCoupon(CouponContract $coupon)
    {
        if (!$this->cart->multipleCoupons) {
            $this->cart->coupons = [];
        }

        $this->cart->coupons[$coupon->code] = $coupon;

        $this->update();
    }
public function addCoupon(CouponContract $coupon)
    {
        if (!$this->cart->multipleCoupons) {
            $this->cart->coupons = [];
        }

        $this->cart->coupons[$coupon->code] = $coupon;

        $this->update();
    }
public function addCoupon ( CouponContract $ coupon ) { if ( ! $ this -> cart -> multipleCoupons ) { $ this -> cart -> coupons = [ ] ; } $ this -> cart -> coupons [ $ coupon -> code ] = $ coupon ; $ this -> update ( ) ; }
Applies a coupon to the cart.

@param CouponContract $coupon
Applies a coupon to the cart .