Skip to content

Instantly share code, notes, and snippets.

@tmzt

tmzt/gist:702937

Created Nov 17, 2010
Embed
What would you like to do?
$catId = $catIds[$catno];
$cat = Mage::getModel('catalog/category')->load($catId);
//$coll = Mage::getResourceModel('reports/product_collection')
$coll = Mage::getModel('catalog/product')->getCollection();
//$coll->addAttributeToFilter('category_ids',array('finset'=>explode(',',array($catId)));
// $coll->addFieldToFilter('category_ids',array('finset'=>explode(',',array($catId)) ));
// $coll->addFieldToFilter('category_ids',array('finset'=>explode(',',array($catId))));
// $coll->addFieldToFilter('featured',array(
// array('name'=>'featured', 'eq'=>'yes')));
foreach ($coll as $prod) {
// print '<p style="color: white;">' . $prod->getId() . '</p>';
$prod->load($prod->getId());
$top = $prod; break;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment