商品明細頁顯示銷售量除了給網店管理員一個快速的商品銷售統計外,也可以讓消費者知道已經有多少人購買了該商品,具有刺激買氣的作用,先看看修改後的樣子:
打開 goods.php (日後若有升級必須重作)約280行找到:
$smarty->display('goods.dwt', $cache_id);
上面增加
/////////////////////////////////////////////////
$smarty->assign('count',selled_count($goods_id));
///////////////////////////////////////////////////
檔案最後增加
$smarty->assign('count',selled_count($goods_id));
///////////////////////////////////////////////////