Skip to content

Commit

Permalink
Merge pull request #8 from ulule/feat-message-empty-cart
Browse files Browse the repository at this point in the history
feat: show message when product is not available
  • Loading branch information
VivienCormier authored Dec 12, 2022
2 parents e791dd1 + 3ff71c1 commit 4f08dcc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions controllers/front/createorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,15 @@ protected function processPostRequest()

$this->module = Module::getInstanceByName('bienoubien');

if (empty($this->context->cart->getProducts())){
$this->ajaxRender(json_encode([
'success' => false,
'message' => 'Check products. The products in your request, are no longer available, cehck availabilities and quantities.',
'psdata' => null,
]));
die;
}

$this->module->validateOrder($cart->id, 2, $total, $this->module->displayName, NULL, $mailVars, (int)$this->context->currency->id, false, $customer->secure_key);

$order = Order::getByCartId($cart->id);
Expand Down

0 comments on commit 4f08dcc

Please sign in to comment.