前几日,接到一客户的ECSHOP二次开发项目,需要在商品搜索页显示商品的货号。
; E# H: L+ @! r) { S% n& C
+ m5 m* v; V6 a/ `% U(1)、
+ G$ J- B: Z/ t& T$ d. J5 J' V( w
打开 search.php 文件 (建议使用editplus 或 Dreamweaver )3 t. E4 n' P" ]) E% R9 C
$ i, ^+ i! r) H- y找到 / s# f/ n/ j {4 w5 c# L$ z4 _
$sql = "SELECT g.goods_id, g.goods_name, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price AS org_price, ". |
: _9 I4 ?. S4 W" Z修改为: _6 O( Y) e$ G' Y2 Z
$sql = "SELECT g.goods_id, g.goods_sn, g.goods_name, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price AS org_price, ". |
* p7 l( f$ s# g0 @$ P+ f8 |继续找到 & h# r# M$ t$ r" b" R) H
$arr[$row['goods_id']]['type'] = $row['goods_type']; | 1 m4 W; X. d# O" x7 F0 O6 y
在这行下面增加以下代码:, v0 b! x6 a h* |
$arr[$row['goods_id']]['goods_sn'] = $row['goods_sn']; |
% M/ _. [/ g& P& d& Z2 Q(2)、
4 p: Z' p- S' C1 Z4 V0 O" c! W/ E5 Z. I- q. {% V" t9 M' Z; S
打开模板文件 search.dwt ,
3 C: `: F) @% I4 O/ d+ E5 U" a在您想要显示商品货号的地方加上下面这句:
. d# {; T! L* v
; v" f4 s/ D! t! w1 k* h4 {+ f产品货号:{$goods.goods_sn}2 ^! g. N' t) P$ o
去后台清空一下缓存,看是不是已经能够显示商品编号了。 & B" { s4 }, h
|