前台显示浏览次数和购买数
1、前台显示浏览次数和购买数
打开core\shop\view\product\index.html,在代码
<{if $mLevel}>
<li class='mprice' <{if $goods.FlatSpec || $goods.SelSpec }> style="display:none" <{/if}>>
<span><{t}>会员价:<{/t}></span>
<ul>
<{foreach from=$mLevel item=lItem name=mlv}>
<li>
<span><{t}><{$lItem.name}>:<{/t}></span>
<span class='mlvprice lv-<{$lItem.member_lv_id}>' mlv='<{$lItem.member_lv_id}>'><{$goods.mprice[$lItem.member_lv_id]|cur}></span>
</li>
<{/foreach}>
</ul>
</li>
<{/if}>
下面插入
<li>
该商品已经被关注 <font color="#FF9900"><{$goods.view_count}></font> 次,已经被购买 <font color="#FF9900"><{$goods.buy_count}></font> 件
</li>
2、后台增加修改浏览次数和购买次数
打开core\admin\view\product\nospec.html,在代码
<{if $prototype.is_physical}>
<tr>
<th><{t}>库存:<{/t}></th>
<td><{input type="unsigned" value=$goods.store name="goods[store]" style="width:60px" maxlength="25" }></td>
</tr>
下面增加
<tr>
<th><{t}>浏览数:<{/t}></th>
<td><{input type="unsigned" value=$goods.view_count name="goods[view_count]" style="width:60px" maxlength="25" }></td>
</tr>
<tr>
<th><{t}>购买数:<{/t}></th>
<td><{input type="unsigned" value=$goods.buy_count name="goods[buy_count]" style="width:60px" maxlength="25" }></td>
</tr>
再清空一下缓存,刷新一下试试看!