Question

On Magento 1, I'm having an issue where the quote and quote item error messages is not persistent.

$item->addErrorInfo('cataloginventory', Mage_CatalogInventory_Helper_Data::ERROR_QTY, $message);

The above code is fine for set the status in that request. However, as soon as another request hit, the error message is not there any more e.g. $quote->getErrors() returns empty array.

I've tried to do $quote->save() as well as $quoteItem->save() but I don't think that's the reason.

Was it helpful?

Solution

Put a break point in Mage_Sales_Model_Quote_Item::removeErrorInfosByParams and Mage_Sales_Model_Quote_Item::_clearErrorInfo to check if there's any other observer method that reset the error info.

OTHER TIPS

Confirming addErrorInfo is only for a single request and not persist into session.

The way Magento core handle the cart error is upon cart update and re-check before checkout progress.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top