From 047a21b2d40bfad9f4be264c2915b626ebbc89cd Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Fri, 23 Oct 2020 19:02:57 +0300 Subject: [PATCH] =?UTF-8?q?#1879=20=C3=9Cr=C3=BCn=20se=C3=A7enekleri=20ve?= =?UTF-8?q?=20GET=20se=C3=A7enekleri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OptionConfigurationController.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/OptionConfigurationController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/OptionConfigurationController.php index 5c63a842c..b3f4ce198 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/OptionConfigurationController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/OptionConfigurationController.php @@ -42,18 +42,20 @@ class OptionConfigurationController extends PublicController public function confAddCart() { - $conf = $this->optionConfigurationRepository->find($this->request->configuration); - $conf->name = $this->optionConfigurationRepository->getName($this->request->configuration); + if($conf = $this->optionConfigurationRepository->find($this->request->configuration)) + { + $conf->name = $conf->getName(); - $this->adv_model->authControl(); + $this->adv_model->authControl(); - if ($conf->stock < $this->request->quantity){ - return redirect()->back()->with('warning', [trans('visiosoft.module.carts::message.error1in2')]); - }else{ - $cart = $this->dispatch(new GetCart()); - $cart->add($conf, $this->request->quantity); - return $this->redirect->to(route('visiosoft.module.carts::cart')); + if ($conf->stock < $this->request->quantity){ + return redirect()->back()->with('warning', [trans('visiosoft.module.carts::message.error1in2')]); + }else{ + $cart = $this->dispatch(new GetCart()); + $cart->add($conf, $this->request->quantity); + return $this->redirect->to(route('visiosoft.module.carts::cart')); + } } } }