shopex472实现按照价格搜索。
有客户需要直接输入价格区间,而不需要输入关键字,这样会很简单。而shopex472的搜索则需要输入关键字才能搜索,将高级搜索价格区间的代码插入,只是输入价格,而不输入关键字,则什么都搜索不到。
代码如下:
<form name=”FORM_TPL_SEARCH” action=”index.php” method=”get”>
{form_hidden_value}
<div class=”price”>价格:</div>
<div class=”formto”>从<input size=”3″ name=”gprice_from” value=”{search_fromprice}” /> 到 <input size=”3″ name=”gprice_to” value=”{search_toprice}” /></div>
<div class=”keywords”><input size=”20″ name=”gkey” value=”{search_key}” /></div>
<div class=”submit”><input name=”Submit” type=”submit” value=”Search” /></div>
<div><a href=”index.php?gOo=goods_search_more.dwt” target=”new”>Advanced search</a></div>
</form>
无意中发现,在高级搜索中,直接输入价格区间不输入关键字,则可以搜索出价格区间内的商品,于是将高级搜索的form直接移植到首页的搜索中去,果然实现了按照价格区间而不输入关键字的搜索。
代码如下:
<form name=”FORM_TPL_SEARCHMORE” action=”index.php” method=”get”>
{form_hidden_value}
<div class=”price”>价格:</div>
<div class=”formto”>从<input size=”3″ name=”gprice_from” value=”{search_fromprice}” /> 到 <input size=”3″ name=”gprice_to” value=”{search_toprice}” /></div>
<div class=”keywords”><input size=”20″ name=”gkey” value=”{search_key}” /></div>
<div class=”submit”><input name=”Submit” type=”submit” value=”Search” /></div>
<div><a href=”index.php?gOo=goods_search_more.dwt” target=”new”>Advanced search</a></div>
</form>
请教,4.8的搜索功能,要实现4.72的按分类查找(首页搜索条那里),不知道怎么实现哦。
在后台没有添加按分类查找的功能,目前只能做成静态的。也就是说把高级搜索的form写在首页的搜索那里。