mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
completed checkout for customer without translate
This commit is contained in:
parent
3463ba8f68
commit
a3d22d972b
@ -46,12 +46,10 @@ class OptionConfigurationController extends PublicController
|
||||
{
|
||||
$conf->name = $conf->getName();
|
||||
|
||||
$this->adv_model->authControl();
|
||||
|
||||
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{
|
||||
$cart = $this->dispatch(new GetCart());
|
||||
$cart = $this->dispatch(new GetCart());
|
||||
$cart->add($conf, $this->request->quantity);
|
||||
return $this->redirect->to(route('visiosoft.module.carts::cart'));
|
||||
}
|
||||
|
||||
@ -1189,26 +1189,21 @@ class AdvsController extends PublicController
|
||||
|
||||
public function addCart(Request $request)
|
||||
{
|
||||
if (\auth()->check()) {
|
||||
$id = $request->id;
|
||||
$quantity = $request->quantity;
|
||||
$name = $request->name;
|
||||
$thisModel = new AdvModel();
|
||||
$adv = $thisModel->isAdv($id);
|
||||
$response = array();
|
||||
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');
|
||||
}
|
||||
$id = $request->id;
|
||||
$quantity = $request->quantity;
|
||||
$name = $request->name;
|
||||
$thisModel = new AdvModel();
|
||||
$adv = $thisModel->isAdv($id);
|
||||
$response = array();
|
||||
if ($adv) {
|
||||
$cart = $thisModel->addCart($adv, $quantity, $name);
|
||||
$response['status'] = "success";
|
||||
$count = $cart->getItems()->count;
|
||||
$response['count'] = $count;
|
||||
} else {
|
||||
$response['status'] = "guest";
|
||||
$response['status'] = "error";
|
||||
$response['msg'] = trans('visiosoft.module.advs::message.error_added_cart');
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user