首页> 站长资讯> 正文

ECSHOP商品列表页显示商品促销级别、特价、热卖、推荐、新品!

来源:鸿兴资讯网
  

首先修改category.php 文件,定位到 category_get_goods() 函数部分

找到

if ($promote_price != 0)

{

$watermark_img = "watermark_promote_small";

}

elseif ($row['is_new'] != 0)

{

$watermark_img = "watermark_new_small";

}

elseif ($row['is_best'] != 0)

{

$watermark_img = "watermark_best_small";

}

elseif ($row['is_hot'] != 0)

{

$watermark_img = 'watermark_hot_small';

}

if ($watermark_img != '')

{

$arr[$row['goods_id']]['watermark_img'] = $watermark_img;

}

增加属性

if ($promote_price != 0)

{

$watermark_img = "watermark_promote_small";

$watermark_txt = "特价";

}

elseif ($row['is_new'] != 0)

{

$watermark_img = "watermark_new_small";

$watermark_txt = "新品";

}

elseif ($row['is_best'] != 0)

{

$watermark_img = "watermark_best_small";

$watermark_txt = "推荐";

}

elseif ($row['is_hot'] != 0)

{

$watermark_img = 'watermark_hot_small';

$watermark_txt = "热卖";

}

if ($watermark_img != '')

{

$arr[$row['goods_id']]['watermark_img'] = $watermark_img;

}

if ($watermark_txt != '')

{

$arr[$row['goods_id']]['watermark_txt'] = $watermark_txt;

}

第二步:修改 themes/default/library/goods_list.lbi 文件

{if $goods.watermark_txt}{$goods.watermark_txt}{/if}

小结:品牌列表类似,找到brand.php 进行修改!记着更新缓存后看效


苏元租房 https://c21.com.cn/
鸿兴资讯网