magento1.9参考:[1]首页随机产品
的有关信息介绍如下:首页随机产品
在你的模版文件中找到分类-产品文件夹
注:我这里以magento1.9.0.0版本默认为例,请根据自己的实际情况修改放置的位置和文件名称
首先在app\design\frontend\rwd\default\template\catalog\product目录下新建home.phtml
然后在home.phtml中加入一下代码
$_products=$this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
?>
count()): ?>
__('There are no products matching the selection.') ?>
__('Recommended Dresses Products') ?>
products_count)?(int)$this->products_count:20; ?>
helper('catalog/output')->productAttribute($_product, $_product->getName() , 'name') ?>
getPriceHtml($_product, true, '-widget-new-grid') ?>
getReviewsSummaryHtml($_product, 'short',true)?>
getChildHtml('product_type_availability'); ?>
Shipping Cost:
Free shipping
isSaleable()): ?>
__('Out of stock') ?>
注:代码中products_count)?(int)$this->products_count:20; ?>
columnCount =4表示每行显示4个根据自己实际情况修改
products_count:20显示多少个随机产品
最后就是在你的网站后台菜单中cms-pages-你的首页文件中加入{{block type="catalog/product_list_random" template="catalog/product/home.phtml" }}即可