I have a loop in a phtml file that search product for a particular attribute. I am beginner on PHP for Magento and I managed to make this foreach.
What I need now is to make a loop that shows the most recently viewed products programmatically to show in my custom phtml file.
Like this ::: http://image.prntscr.com/image/8111de5ee8a94957bc7bd815f756040c.png
Anyone help me to make this loop?
$_productCollection = Mage::getModel('catalog/product')
->getCollection()
// add sorting to collection optional
->addAttributeToFilter('a_nao_pode_faltar_dtumpouco', array('eq' => 1))
->addAttributeToSort('created_at', 'DESC')
->addAttributeToSelect('*')
->load();
foreach ($_productCollection as $_product){
This loop I made for custom product attribute! Now, I need a loop for lastviewed products.