I need to know how can I display products in a page like (cart, below total) only few products by ID. Eg: products with id 2,3,4 and 5.
load($category_id);
$collection = Mage::getResourceModel('catalog/product_collection')->setPageSize(4);;
$collection->addCategoryFilter($catagory_model); //category filter
$collection->addAttributeToFilter('status',1); //only enabled product
$collection->addAttributeToSelect(array('name','url','small_image','price','sku')); //add product attribute to be fetched
//$collection->getSelect()->order('rand()'); //uncomment to get products in random order
$collection->addStoreFilter();
if(!empty($collection))
{ ?>
";
}
?>
- 热议问题