mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
addCart action changed and added cart count
This commit is contained in:
parent
699ed091bd
commit
160a3ecc0c
@ -220,8 +220,8 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\OptionConfigurationController@confAddCart',
|
||||
],
|
||||
|
||||
'ajax/conf/addCart' => [
|
||||
'as' => 'configuration::add_cart',
|
||||
'api/conf/add-cart' => [
|
||||
'as' => 'configuration::api_add_conf_cart',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\OptionConfigurationController@ajaxConfAddCart',
|
||||
],
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ class OptionConfigurationController extends PublicController
|
||||
$this->adv_model->authControl();
|
||||
|
||||
if ($conf->stock < $this->request->quantity){
|
||||
return redirect()->back()->with('warning', [trans('visiosoft.module.carts::message.error1in2')]);
|
||||
return $this->response->json(['status' => 'error', 'msg' => trans('visiosoft.module.carts::message.error1in2')]);
|
||||
}else{
|
||||
$cart = $this->dispatch(new GetCart());
|
||||
$cart->add($conf, $this->request->quantity);
|
||||
@ -76,5 +76,6 @@ class OptionConfigurationController extends PublicController
|
||||
return $this->response->json(['status'=> 'success', 'count' => $count]);
|
||||
}
|
||||
}
|
||||
return $this->response->json(['status' => 'error', 'msg' => trans('visiosoft.module.carts::message.error2')]);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user