diff --git a/controllers/front/failIFrame.php b/controllers/front/failIFrame.php index 8471d279..e1193835 100755 --- a/controllers/front/failIFrame.php +++ b/controllers/front/failIFrame.php @@ -49,6 +49,14 @@ public function initContent() { parent::initContent(); + $cart = new \Cart(Tools::getValue('cartId')); + + /** + * Note: deleting cart prevents + * from further failing when creating order with same cart + */ + $cart->delete(); + /** @var LoggerInterface $logger */ $logger = $this->module->getService(LoggerInterface::class); diff --git a/controllers/front/return.php b/controllers/front/return.php index 2b7c8995..3f557fa3 100755 --- a/controllers/front/return.php +++ b/controllers/front/return.php @@ -290,12 +290,13 @@ private function getOrderId($cartId) */ private function getRedirectionToControllerUrl($controllerName) { + $cartId = $this->context->cart->id ? $this->context->cart->id : Tools::getValue('cartId'); return $this->context->link->getModuleLink( $this->module->name, $controllerName, [ - 'cartId' => $this->context->cart->id, - 'orderId' => Order::getOrderByCartId($this->context->cart->id), + 'cartId' => $cartId, + 'orderId' => Order::getOrderByCartId($cartId), 'secureKey' => $this->context->cart->secure_key, 'moduleId' => $this->module->id, ]