网站开发 · 2025年4月24日

在Ecshop搜索结果页显示商品的市场价格

注:此方法同样适用于【如何在精品推荐、热卖商品、新品上市的“更多”页面里显示市场价格】

下面以官方默认模板(2.7.2)为例进行讲解.

第一步,打开 /themes/default/search.dwt

找到(注意有两处

<!– {if $show_marketprice} –>
              {$lang.market_price}<font class=”market”>{$goods.market_price}</font><br />
              <!– {/if} –>

将它修改为

  {$lang.market_price}<font class=”market”>{$goods.market_price}</font><br />          

继续找到(只有一处

<!– {if $show_marketprice} –>
                        {$lang.market_prices}<font class=”market_s”>{$goods.market_price}</font><br />
                        <!– {/if} –>

同样将它修改为

{$lang.market_prices}<font class=”market_s”>{$goods.market_price}</font><br />

感觉这个 $show_marketprice  根本没起作用,在对应的程序文件里也没找到赋值的地方。个人认为是官方2.7.2默认模板的一个小BUG。