怎么在商城中加入按商品編號搜索的功能?_動易Cms教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!


      問題:如何在商城中加入按“商品編號”搜索的功能?

      解決方法:
      (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'>品牌/商標(biāo)</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 & "%' "

      查看更多 動易Cms教程  動易Cms模板

      共2頁上一頁12下一頁
      來源:模板無憂//所屬分類:動易Cms教程/更新時間:2008-05-12
      相關(guān)動易Cms教程