category.php

下面的

category_get_goods

函数中foreach循环添加

$arr[$row['goods_id']]['count']            = selled_count($row['goods_id']);

文件的最后部分添加函数

  function selled_count($goods_id)
{
     $sql= "select sum(goods_number) as count from ".$GLOBALS['ecs']->table('order_goods')."where goods_id ='".$goods_id."'";
     $res = $GLOBALS['db']->getOne($sql);
     if($res>0)
     {
     return $res;
     }
     else
     {
       return('0');
     }
}

模板

goods_list.lbi

 

<a href="javascript:;" id="compareLink"html"}','{$goods.type}')">{$lang.compare}</a>

 下添加

  销售量:{$goods.count}