问题:如何在商城中加入按“商品编号”搜索的功能?
解决方法:
(1)在商城前台加入按商品编号搜索,直接修改“搜索页模板”,可以参考/help/SiteWeaver/1333.html
(2)在商城后台加入按商品编号搜索,需要修改Admin目录下的Admin_Product.asp文件
1、第179行
Response.Write "<form method='Get' name='SearchForm' action='" & FileName & "'>"
Response.Write "<td><b>高级查询:</b>"
Response.Write "<select name='Field' size='1'>"
Response.Write "<option value='ProductName' selected>" & ChannelShortName & "名称</option>"
Response.Write "<option value='ProductIntro'>" & ChannelShortName & "简介</option>"
Response.Write "<option value='ProductExplain'>" & ChannelShortName & "介绍</option>"
Response.Write "<option value='ProductNum'>商品编号</option>"
Response.Write "<option value='ProducerName'>厂商</option>"
Response.Write "<option value='TrademarkName'>品牌/商标</option>"
Response.Write "<option value='ID'>" & ChannelShortName & "ID</option>"
Response.Write "</select>"
Response.Write "<select name='ClassID'><option value=''>所有栏目</option>" & GetClass_Option(1, 0) & "</select>"
Response.Write "<input type='text' name='keyword' size='15' value='要害字' maxlength='50' onFocus='this.select();'>"
Response.Write "<input type='submit' name='Submit' value='搜索'>"
Response.Write "<input name='SearchType' type='hidden' id='SearchType' value='-1'>"
Response.Write "<input name='ManageType' type='hidden' id='ManageType' value='" & ManageType & "'>"
Response.Write "<input name='ChannelID' type='hidden' id='ChannelID' value='" & ChannelID & "'>"
Response.Write "</td></form>"
----增加了红色的一行。
2、第460行
If Keyword <> "" Then
Select Case strField
Case "ProductName"
Querysql = Querysql & " and P.ProductName like '%" & Keyword & "%' "
Case "ProductIntro"
Querysql = Querysql & " and P.ProductIntro like '%" & Keyword & "%' "
Case "ProductExplain"
Querysql = Querysql & " and P.ProductExplain like '%" & Keyword & "%' "
Case "ProducerName"
Querysql = Querysql & " and P.ProducerName like '%" & Keyword & "%' "
Case "TrademarkName"
Querysql = Querysql & " and P.TrademarkName like '%" & Keyword & "%' "
Case "ProductNum"
Querysql = Querysql & " and P.ProductNum like '%" & Keyword & "%' "
Case Else
Querysql = Querysql & " and P.ProductName like '%" & Keyword & "%' "
新闻热点
疑难解答
图片精选