问:- {* }& D4 w" z5 z
ecshop商品详细页面的商品品牌默认是以文字形式显示的,能否改成以LOGO形式显示。
" M' A3 H, T5 G$ n. l/ v+ u- v9 i" |) q* c4 l8 n+ ^6 p) m
答:5 c4 m9 g* N! p+ Y2 s7 k. I- r8 q
: ?; f4 i, w9 q: B9 ~) X
当然可以,下面看教程。注:本教程以 ECSHOP2.7.2 + 官方默认模板 为例。* x# [0 v" X9 O" A% I
- d w# h. v9 W ^
1)、首先需要修改 /includes/lib_goods.php ,
: U+ O3 @/ C3 `2 L# @用EditPlus或Dreamweaver打开该文件,+ {& i: `) S7 U& y$ s m9 a) u V
' E/ b+ v2 I2 u/ o6 p( ?找到 $sql = 'SELECT g.*, c.measure_unit, b.brand_id, b.brand_name AS goods_brand, m.type_money AS bonus_money, ' . |
- j9 X, g, j$ q" ?修改为$sql = 'SELECT g.*, c.measure_unit, b.brand_id,b.brand_logo, b.brand_name AS goods_brand, m.type_money AS bonus_money, ' . |
1 f" E3 j6 M' k* w' R8 r
$ C8 c' j' ^7 R) W: j7 D6 \4 x2)、% y# |% ?* E ~5 |% \; `$ \5 L
接着修改 /themes/default/goods.dwt J/ w& j4 |5 S1 g V
; e* \; H. q) _# b将0 y4 y7 K; U0 @4 Z7 _& _
{$goods.goods_brand}& j7 X' _% Q, Z6 M' c1 {1 I
5 p# G! G+ s7 u$ Z& v修改为& t7 U% p, o4 {+ t/ g! f
{if $goods.brand_logo}<img src=/data/brandlogo/{$goods.brand_logo}>{else}{$goods.goods_brand}{/if}/ }" j% m4 a& k2 `( f7 T
|