Magento get loaded collection
Posted
by
Zertalx
on Stack Overflow
See other posts from Stack Overflow
or by Zertalx
Published on 2012-06-14T22:20:11Z
Indexed on
2012/06/17
21:16 UTC
Read the original article
Hit count: 154
Hey guys I got an issue in magento when listing products.
$_productCollection = array(); $key = 'product_collection_'.Mage::app()->getRequest()->getRequestUri(); $_productCollection = Mage::helper('cache')->getDataInCache($key); if (empty($_productCollection)) { $_productCollection=$this->getLoadedProductCollection(); Mage::helper('cache')->setDataInCache($key,$_productCollection,'front_end_collection'); }
That's my code, i'm loading the collection and saved in cache, the problem is that I added new products from the admin panel but they are not showing up in the listing.
I have refreshed cache, reindex all the data and checke that the products were in stock. Also check the visibility because i understand that the collection gets just the visible products, am i correct?
I'm using magento enterprise 1.9
I'm new in magento and i'm having troubles understanding how the Collections works, i hope somebody can help me. Thanks
© Stack Overflow or respective owner