From 6169d145e30087f691bc74cd67fd27e4768ca78c Mon Sep 17 00:00:00 2001 From: iesus Date: Wed, 4 Sep 2019 08:11:23 +0200 Subject: [PATCH] on validation, if no queueitem is found, load quote by id --- .../Svea/Checkout/controllers/PushController.php | 2 +- .../Svea/Checkout/controllers/ValidationController.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/code/community/Svea/Checkout/controllers/PushController.php b/app/code/community/Svea/Checkout/controllers/PushController.php index 75c4fbb..1bfa3b1 100755 --- a/app/code/community/Svea/Checkout/controllers/PushController.php +++ b/app/code/community/Svea/Checkout/controllers/PushController.php @@ -25,7 +25,7 @@ public function indexAction() if (!$orderQueueItem->getId()) { - return $this->reportAndReturn(404, "QueueItem {$quoteId} not found in queue."); + return $this->reportAndReturn(404, "Quote {$quoteId} not found in queue."); } try { $quote = $this->_getQuoteById($quoteId); diff --git a/app/code/community/Svea/Checkout/controllers/ValidationController.php b/app/code/community/Svea/Checkout/controllers/ValidationController.php index c3e5683..284653f 100755 --- a/app/code/community/Svea/Checkout/controllers/ValidationController.php +++ b/app/code/community/Svea/Checkout/controllers/ValidationController.php @@ -25,8 +25,16 @@ public function indexAction() $orderQueueItem = Mage::getModel('sveacheckout/queue')->load($quoteId, 'quote_id'); if (!$orderQueueItem->getId()) { + $quote = $this->_getQuoteById($quoteId); + if ($quote->getId() && $quote->getIsActive()) { + + Mage::helper('sveacheckout/Debug')->writeToLog( + "quote: {$quoteId} had no queueitem, got quote from ID" + ); + } else { - return $this->reportAndReturn(204, "QueueItem {$quoteId} not found in queue."); + return $this->reportAndReturn(204, "QueueItem {$quoteId} not found in queue."); + } } try {