diff --git a/ajax/frontend/basket/toOrderInProcess.php b/ajax/frontend/basket/toOrderInProcess.php index 2fba39002fa08501669842c421cbad1ac92f2cb8..ddb6cf7774e5d862c421417e2202185841e236ca 100644 --- a/ajax/frontend/basket/toOrderInProcess.php +++ b/ajax/frontend/basket/toOrderInProcess.php @@ -4,6 +4,8 @@ * This file contains package_quiqqer_order_ajax_frontend_basket_toOrderInProcess */ +use QUI\ERP\Order\Factory; + /** * Saves the basket to the temporary order * @@ -35,15 +37,12 @@ function ($basketId, $orderHash) { if ($Order === null) { try { $Order = $OrderHandler->getLastOrderInProcessFromUser($User); - } catch (QUI\Exception $Exception) { - QUI\System\Log::writeDebugException($Exception); + } catch (QUI\Exception) { + $Order = Factory::getInstance()->createOrderInProcess(); } } - if ($Order) { - $Basket->toOrder($Order); - } - + $Basket->toOrder($Order); return $Order->getUUID(); },