mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-12 16:26:07 -06:00
addCart action changed and added cart count
This commit is contained in:
parent
160a3ecc0c
commit
7c06f4338c
@ -60,6 +60,7 @@ class OptionConfigurationController extends PublicController
|
||||
|
||||
public function ajaxConfAddCart()
|
||||
{
|
||||
if (\auth()->check()) {
|
||||
if($conf = $this->optionConfigurationRepository->find($this->request->configuration))
|
||||
{
|
||||
$conf->name = $conf->getName();
|
||||
@ -78,4 +79,6 @@ class OptionConfigurationController extends PublicController
|
||||
}
|
||||
return $this->response->json(['status' => 'error', 'msg' => trans('visiosoft.module.carts::message.error2')]);
|
||||
}
|
||||
return $this->response->json(['status' => 'guest']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1200,6 +1200,8 @@ class AdvsController extends PublicController
|
||||
if ($adv) {
|
||||
$cart = $thisModel->addCart($adv, $quantity, $name);
|
||||
$response['status'] = "success";
|
||||
$count = $cart->getItems()->count;
|
||||
$response['count'] = $count;
|
||||
} else {
|
||||
$response['status'] = "error";
|
||||
$response['msg'] = trans('visiosoft.module.advs::message.error_added_cart');
|
||||
@ -1208,8 +1210,6 @@ class AdvsController extends PublicController
|
||||
$response['status'] = "guest";
|
||||
}
|
||||
|
||||
$count = $cart->getItems()->count;
|
||||
$response['count'] = $count;
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user