Skip to content

Commit

Permalink
on validation, if no queueitem is found, load quote by id
Browse files Browse the repository at this point in the history
  • Loading branch information
iesus committed Sep 4, 2019
1 parent 300a7c1 commit 6169d14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6169d14

Please sign in to comment.