completed checkout for customer without translate

This commit is contained in:
vedatakd 2021-02-24 12:16:05 +03:00
parent 3463ba8f68
commit a3d22d972b
2 changed files with 15 additions and 22 deletions

View File

@ -46,12 +46,10 @@ class OptionConfigurationController extends PublicController
{ {
$conf->name = $conf->getName(); $conf->name = $conf->getName();
$this->adv_model->authControl();
if ($conf->stock < $this->request->quantity){ if ($conf->stock < $this->request->quantity){
return redirect()->back()->with('warning', [trans('visiosoft.module.carts::message.error1in2')]); return redirect()->back()->with('warning', [trans('visiosoft.module.carts::message.error1in2')]);
}else{ }else{
$cart = $this->dispatch(new GetCart()); $cart = $this->dispatch(new GetCart());
$cart->add($conf, $this->request->quantity); $cart->add($conf, $this->request->quantity);
return $this->redirect->to(route('visiosoft.module.carts::cart')); return $this->redirect->to(route('visiosoft.module.carts::cart'));
} }

View File

@ -1189,26 +1189,21 @@ class AdvsController extends PublicController
public function addCart(Request $request) public function addCart(Request $request)
{ {
if (\auth()->check()) { $id = $request->id;
$id = $request->id; $quantity = $request->quantity;
$quantity = $request->quantity; $name = $request->name;
$name = $request->name; $thisModel = new AdvModel();
$thisModel = new AdvModel(); $adv = $thisModel->isAdv($id);
$adv = $thisModel->isAdv($id); $response = array();
$response = array(); if ($adv) {
if ($adv) { $cart = $thisModel->addCart($adv, $quantity, $name);
$cart = $thisModel->addCart($adv, $quantity, $name); $response['status'] = "success";
$response['status'] = "success"; $count = $cart->getItems()->count;
$count = $cart->getItems()->count; $response['count'] = $count;
$response['count'] = $count;
} else {
$response['status'] = "error";
$response['msg'] = trans('visiosoft.module.advs::message.error_added_cart');
}
} else { } else {
$response['status'] = "guest"; $response['status'] = "error";
$response['msg'] = trans('visiosoft.module.advs::message.error_added_cart');
} }
return $response; return $response;
} }