From a4aee59a7fa9255a25c640db9bcdd8416d9b0ae0 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Thu, 27 Jan 2022 17:57:19 +0300 Subject: [PATCH] #5216 hali.ocify requests --- .../src/Http/Controller/OptionConfigurationController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 87fb1c605..5d5ea1c42 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/OptionConfigurationController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/OptionConfigurationController.php @@ -67,7 +67,10 @@ class OptionConfigurationController extends PublicController public function confAddCart() { if ($conf = $this->optionConfigurationRepository->find($this->request->configuration)) { - if ($conf->parent_adv->getStatus() == "approved") { + + $parent_adv = $conf->parent_adv; + + if ($parent_adv->getStatus() == "approved") { $conf->name = $conf->getName(); if ($conf->stock < $this->request->quantity) { @@ -75,7 +78,8 @@ class OptionConfigurationController extends PublicController } else { $cart = $this->dispatch(new GetCart()); $cart->add($conf, $this->request->quantity); - return $this->redirect->to(route('visiosoft.module.carts::cart')); + $this->messages->success(trans('visiosoft.module.carts::message.success')); + return $this->redirect->to($parent_adv->detail_url); } } $this->messages->info(trans('visiosoft.module.advs::message.error_added_cart'));