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.
get Product from specific category
$categoryIds = array(2,4);//category id
$collection = Mage::getModel('catalog/product')
->getCollection()
->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
->addAttributeToSelect('*')
->addAttributeToFilter('category_id', array('in' => $categoryIds))
get Product for specific product id
$productids = array(52,62);//product ids
$collection = Mage::getResourceModel('catalog/product_collection');
$collection->addFieldToFilter('entity_id',array( 'in' => $productids));
then write this in phtml
count() ?>
getColumnCount(); ?>
-
getName() ?>
currency($product->getPrice(),true,false);?>
isSaleable()): ?>
__('Out of stock') ?>
hope this help you