category.php列表栏显示属性参数,如图:

ecshop-property-show-in-catogery

方法:在category.php的 function category_get_goods 函数的

  1. while ($row = $GLOBALS['db']->fetchRow($res))
  2.     {

下面加入:

  1. /*----------------Jet加的取得商品属性-------------------*/
  2.   $properties = get_goods_properties($row['goods_id']);
  3.   $arr[$row['goods_id']]['propertie'] = $properties['pro'];

属性调用和数组赋值,取pro属性;

前台显示:

在category.dwt和goods_list.lbi的{$goods.goods_name}下面加入:

  1. <!-- {foreach from=$goods.propertie item=propertys key=key} -->
  2.         
  3.               <!-- {foreach from=$propertys item=property} -->
  4.           
  5.                 {$property.name|escape:html}{$property.value|escape:html}
  6.           
  7.               <!-- {/foreach}-->
  8.               <!-- {/foreach}-->

如此,前台列表文件即显示相应产品的属性了。

如果你是第一次来这儿,欢迎订阅 feedsky RSS feed。 第一时间看到更多精彩内容,谢谢你的访问!
原文地址:http://my.xoao.com/ecshop-goods-properties-show-in-category
转载请注明出处,非常感谢!
Jet on 01月 21st, 2008 | File Under PHP | -