diff --git a/src/CartItem.php b/src/CartItem.php index 83cbafe..c1605e4 100644 --- a/src/CartItem.php +++ b/src/CartItem.php @@ -275,6 +275,10 @@ public function getDiscount($format = true) ); } + /** + * @param CouponContract $coupon + * @return $this + */ public function addCoupon(CouponContract $coupon) { $coupon->appliedToCart = false; @@ -282,6 +286,8 @@ public function addCoupon(CouponContract $coupon) $this->code = $coupon->code; $this->couponInfo = $coupon->options; $this->discount = $coupon->discount($this); + + return $this; } /** @@ -376,12 +382,18 @@ public function searchForSubItem($data) return $matches; } + /** + * + */ public function disable() { $this->active = false; app('laracart')->update(); } + /** + * + */ public function enable() { $this->active = true;