Skip to content

Instantly share code, notes, and snippets.

@tmzt
Created November 17, 2010 03:35
Show Gist options
  • Save tmzt/702937 to your computer and use it in GitHub Desktop.
Save tmzt/702937 to your computer and use it in GitHub Desktop.
$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