From a645735f93e37187fbc1e70831befd832827857e Mon Sep 17 00:00:00 2001 From: Fahim Date: Tue, 31 Aug 2021 16:50:51 +0600 Subject: [PATCH] Fix #4 --- app/Http/Livewire/ProductCart.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Http/Livewire/ProductCart.php b/app/Http/Livewire/ProductCart.php index ed17d451..489bcbef 100644 --- a/app/Http/Livewire/ProductCart.php +++ b/app/Http/Livewire/ProductCart.php @@ -115,9 +115,11 @@ class ProductCart extends Component } public function updateQuantity($row_id, $product_id) { - if ($this->check_quantity[$product_id] < $this->quantity[$product_id]) { - session()->flash('message', 'The requested quantity is not available in stock.'); - return; + if ($this->cart_instance == 'sale' || $this->cart_instance == 'purchase_return') { + if ($this->check_quantity[$product_id] < $this->quantity[$product_id]) { + session()->flash('message', 'The requested quantity is not available in stock.'); + return; + } } Cart::instance($this->cart_instance)->update($row_id, $this->quantity[$product_id]);