Header Ad

Wednesday, April 21, 2010

Ability to retrieve products under a brand or manufacturer in MAGENTO

$brandId = "1"; //manufacturer id or brand id
$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToFilter('manufacturer', array('in' => array($brandId)));
$products->addAttributeToFilter('status', '1');
$products->addAttributeToSelect('*');
$products->load();

echo "
";
foreach($products as $product)
echo $product->getId()."
";

No comments: