1、以下是我修改后的代码,效果图在代码下面:
getCategoryIds(); ?>
load($cat_id);
$collection = $category->getProductCollect
2、ion();
foreach ($collection as $product) {
$result[] = $product->getId();
}
}
?>
You May Also Like
= 4)
{
$ourneed = array_rand($result,4);
foreach($ourneed as $cc)
{
8、 $thisproduct= Mage::getModel('catalog/product')->load($result[$cc]);
?>
-
getPriceHtml($thisproduct, true, '-new') ?>
load($cc);
?>
-
12、cho $thisproduct->getName(); ?>
P.S:
20120426修订版,修复了推荐产品价格与当前产品价格一样的BUG,主要将原来的语句
getPriceHtml($_product, true, '-new') ?>
修改为以下语句
getPriceHtml($th
13、isproduct, true, '-new') ?>
相应的CSS样式:
/************************详细页推荐产品*******************/
.box-others-also-like { height:670px; }
.like-left { float:left; width:49%; }
.like-right { float:right; width:49%; }
.like-left li, .like-right li { height:150px; margin-bottom:10px; border:1px #bbbbbb solid; }
.like-image { float:left; width:150px; }
.like-word { float:right; width:150px; margin:0 10px; }
.like-word-a { font-size:14px; margin-top:5px; height:80px; }