Jump to content

[Solved] Configuring the products "sort by" new product


Recommended Posts

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

  • 1 month later...
  • 2 years later...
  • 2 years later...

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

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

  • 1 year later...

 

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 by robertsona (see edit history)
Link to comment
Share on other sites

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...