首先,打开flow.php,在显示购物车产品的地方加下面这段代码
if ($cart_goods['goods_list']){
foreach ($cart_goods['goods_list'] as $k => $v){
$properties = get_goods_properties($v['goods_id']);
if($m = $properties['pro']['商品規格']){
$cart_goods['goods_list'][$k]['attribute'][] = $m;
}
}
}
然后打开模板flow.dwt,将显示商品属性里面的程序修改成如下
{foreach from = $goods.attribute item = item}{foreach from=$item item=i}{$i.name}:{$i.value}
{/foreach}{/foreach}
更新缓存,就可以看到购物车中有商品属性显示.