ECSHOP 将产品属性显示在列表栏里-category.php
category.php列表栏显示属性参数,如图:
方法:在category.php的 function category_get_goods 函数的
while ($row = $GLOBALS['db']->fetchRow($res))
{
下面加入:
/*—————-Jet加的取得商品属性——————-*/
$properties = get_goods_properties($row['goods_id']);
$arr[$row['goods_id']]['propertie'] = $properties['pro'];
属性调用和数组赋值,取pro属性;
前台显示:
在category.dwt和goods_list.lbi的{$goods.goods_name}下面加入:
<!– {foreach from=$goods.propertie item=propertys key=key} –>
<!– {foreach from=$propertys item=property} –>
{$property.name|escape:html}{$property.value|escape:html}
[...]
阅读完整的文章... Jet on 01月 21st, 2008 | File Under PHP | 7 Comments -