From 73b0702cd81b9530f0d94a890286cf160bd44b91 Mon Sep 17 00:00:00 2001 From: Luke Policinski Date: Sat, 27 Jan 2018 11:49:25 -0500 Subject: [PATCH] return cart itemclear --- src/CartItem.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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;