产品默认排序不适用于 search.tpl - Prestashop 1.6.0.6 [英] Products default sort not working on search.tpl - Prestashop 1.6.0.6
问题描述
我在后台将默认排序类型设置为:有货.这适用于除 SearchController 模板文件之外的所有页面:search.tpl.
I set up in backoffice the default sort type to : in stock. this works for all pages except SearchController template file : search.tpl.
造成这种功能障碍的原因是什么?我真的不知道要处理哪部分代码.感谢所有遇到此类问题的人提供建议.
What can be the causes behind such dysfunctionning? I really don't know what part of code to deal with. Thanks everyone who already met such issue for advices.
我发现点击搜索按钮后地址栏中的链接是:
I discovered that the link in the adress bar after click on search button is:
website/index.phpcontroller=search&orderby=position&orderway=desc&search_query=design+40&submit_search=Rechercher
当我删除 orderby=position&orderway=desc
时,默认行为有效.我只需要从控制器中删除此操作,但仍然不知道如何操作.
When I remove orderby=position&orderway=desc
, the default behaviour works. I just need to remove this action from controller but still don't know how.
推荐答案
在模板文件中,我发现:
In template file, I found:
<form method="get" action="{$link->getPageLink('search')|escape:'html'}" id="searchbox">
<p>
<label for="search_query_top"><!-- image on background --></label>
<input type="hidden" name="controller" value="search" />
<input type="hidden" name="orderby" value="quantity" />
<input type="hidden" name="orderway" value="desc" />
<input class="search_query" type="text" id="search_query_top" name="search_query" value="{$search_query|escape:'html':'UTF-8'|stripslashes}" />
<input type="submit" name="submit_search" value="{l s='Search' mod='blocksearch'}" class="button" />
</p>
</form>
如您所见,我已经将隐藏输入的值更改为 quantity
.希望有帮助.
As you see, I have already changed the value of the hidden input to quantity
. Hope it helps.
这篇关于产品默认排序不适用于 search.tpl - Prestashop 1.6.0.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!