Open m-overlund opened 1 year ago
How can we reproduce this issue as steps?
I have encountered this issue. In my case we have 2 stores for example store_id 1 and store_id 2. we have a code that will get all visible items from quote in both stores (this code runs in cron).
foreach ($objects['quote']->getAllVisibleItems() as $item) {
$product = Mage::getModel('catalog/product')->setStoreId($item->getStoreId());
$product->load($item->getProductId());
// ....
}
Stacktrace:
Abstract.php:82, Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract->_getWebsiteCurrencyRates()
Abstract.php:188, Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract->preparePriceData()
Abstract.php:235, Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract->afterLoad()
Abstract.php:640, Mage_Eav_Model_Entity_Abstract->walkAttributes()
Abstract.php:1616, Mage_Eav_Model_Entity_Abstract->_afterLoad()
Abstract.php:943, Mage_Eav_Model_Entity_Abstract->load()
Abstract.php:739, Mage_Catalog_Model_Resource_Abstract->load()
Abstract.php:285, Mage_Core_Model_Abstract->load()
Issue: The value of $this->_rates remains the same throughout the loop (code above).
I temporarily fixed it by modifying Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract::_getWebsiteCurrencyRates()
if (is_null($this->_rates)) {
$this->_rates = [];
}
if (! isset($this->_rates[$websiteId])) {
$baseCurrency = Mage::app()->getBaseCurrencyCode();
//....
}
I am getting this warning
I suspect it could be related to products having a group price set for a specific website.
Afterwards the website is unassigned on that product and website id is no longer set.