leeloo Posted October 19, 2010 Share Posted October 19, 2010 HelloI would like to add sorting:by new product in the product-sort.tplSomeone can help me? Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2010 Share Posted October 20, 2010 Why don't you just go to Preferences > Products and change the "Default order by"? You can change it to "Product added date" and "Default order way" to "Decreasing" if you want products ordered from newest to oldest, where modified products aren't considered new. If you want modified products to be considered new, choose "Product modified date" instead. Link to comment Share on other sites More sharing options...
leeloo Posted October 20, 2010 Author Share Posted October 20, 2010 No, what I want to do is add to the visitor a choice in the dropdown of product-sort.tpl. Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2010 Share Posted October 20, 2010 In that case, try editing product-sort.tpl and adding the following to the options: {l s='new products'} 1 Link to comment Share on other sites More sharing options...
leeloo Posted October 20, 2010 Author Share Posted October 20, 2010 Thank you very much rocky,It works perfectly. Link to comment Share on other sites More sharing options...
tondacz Posted November 29, 2010 Share Posted November 29, 2010 This code doesn't work with 1.3.2 . Anyone make it work , please ?? Link to comment Share on other sites More sharing options...
mellowman Posted September 12, 2013 Share Posted September 12, 2013 In PS 1.5 try this: <option value="date_add:desc" {if $orderby eq 'date_add' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='New products'}</option> 1 Link to comment Share on other sites More sharing options...
tony_mik Posted September 23, 2015 Share Posted September 23, 2015 In that case, try editing product-sort.tpl and adding the following to the options: <option value="{$link->addSortDetails($request, 'date_add', 'desc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'date_add' AND $orderway eq 'DESC'}selected="selected"{/if}>{l s='new products'}</option> Thank you! This solved my problem (Prestashop 1.6.1.1). Link to comment Share on other sites More sharing options...
Jorge83 Posted September 24, 2015 Share Posted September 24, 2015 Hello, I added a custom field in the database (table = product), I´m trying to sort products by this field but prestashop sorts by the order which products were inserted. The data in the database are correct. I don´t know why it doesn´t work Someone can help me? Link to comment Share on other sites More sharing options...
robertsona Posted December 13, 2016 Share Posted December 13, 2016 (edited) In PS 1.5 try this: <option value="date_add:desc" {if $orderby eq 'date_add' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='New products'}</option> is there a way to make this work in search? It works fine on the cataegory pages but if i search an item nothing shows up but it still shows 64 items or whatever found Thanks! Edited December 13, 2016 by robertsona (see edit history) Link to comment Share on other sites More sharing options...
Nikoleta Posted February 7, 2017 Share Posted February 7, 2017 Hi , I would like to add sorting by "Discounts %" in the product-sort.tpl then the visitiors can choise in the dropdown of Sort by... Can anyone help me? Thank you in advance Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now