drakulitkas Posted July 9, 2015 Report Share Posted July 9, 2015 (edited) Реализовал сортировку по цене (от большего к меньшему и наоборот)http://forum.simplacms.ru/topic/8330-сортировка-товаров-товар-c-кол-вом-0-в-конец-списк/?hl=сортировка Помогите пожалуйста правильно добавлять параметр к URL (?sort=price-max или ?sort=price-min)Чтобы получалось (напр.: http://domen.ru/catalog/category?sort=price-min и http://domen.ru/catalog/category?sort=price-min) {if $products|count>0} <div class="sortprice"> Сортировать по <ul class="sortlist"> <select onchange="location = this.value;"> <option value="{url sort=price-min page=null}{if $sort==price-max}" selected{/if}>Down</option> <option value="{url sort=price-max page=null}{if $sort==price-min}" selected{/if}>Up</option> </select> </ul> <div class="clearfix"></div> </div> {/if} Сейчас работает так: http://domen.ru/catalog/category?sort=0 Edited July 9, 2015 by drakulitkas Quote Link to post Share on other sites
mishanya Posted July 9, 2015 Report Share Posted July 9, 2015 так есть же в сортировке параметр этот и по ончейндж он меняется {url sort=price-min page=null} {url sort=price-max page=null} Quote Link to post Share on other sites
drakulitkas Posted July 9, 2015 Author Report Share Posted July 9, 2015 (edited) так есть же в сортировке параметр этот и по ончейндж он меняется {url sort=price-min page=null} {url sort=price-max page=null} .. должен меняться, но при нажатии добавляет к URL ?sort=0если дописываю параметр вручную, все работает, а через select не хочет, ставит ?sort=0 Edited July 9, 2015 by drakulitkas Quote Link to post Share on other sites
Solution mishanya Posted July 9, 2015 Solution Report Share Posted July 9, 2015 возьмите в скобки {url sort='price-min' page=null} {url sort='price-max' page=null} Quote Link to post Share on other sites
drakulitkas Posted July 9, 2015 Author Report Share Posted July 9, 2015 возьмите в скобки {url sort='price-min' page=null} {url sort='price-max' page=null} Спасибо )) заработало )) {if $products|count>0} <div class="sort"> Сортировать по <ul class="filter-widget"> <select onchange="location = this.value;"> <option value="{url sort='price-min' page=null}"{if $sort=='price-min'} selected{/if}>Down</option> <option value="{url sort='price-max' page=null}"{if $sort=='price-max'} selected{/if}>Up</option> </select> </ul> <div class="clearfix"></div> </div> {/if} Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.