Display magento products by category ID

后端 未结 4 1211
滥情空心
滥情空心 2020-12-16 08:24

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.

4条回答
  •  清酒与你
    2020-12-16 09:03

        
    
    
      ";  
           } 
          ?>      
           
    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)) { ?>
    getProductUrl(); $pro_url2=str_replace("rishabh_daily_report_cron2.php/","",$pro_url);?> getName()."
    "; //echo $_product->getSku()."
    "; echo $_product->getSpecialPrice(); ?>

    提交回复
    热议问题