I am trying to show the latest products in my magento store.
What is a recent product? It is determined by two criteria:
I would like to order my product indifferently between created_at and news_from_date, and not by one criterion, but the second after.
Any ideas?
I have already tried the following code:
->addAttributeToSort('created_at, news_from_date', 'desc')
OR
->addAttributeToSort('news_from_date', 'desc')
->addAttributeToSort('created_at', 'desc')
OR
->addAttributeToSort(array('created_at' => 'desc', 'news_from_date' => 'desc'))
OR
->addAttributeToSort(array('created_at', 'news_from_date'), 'desc'))
ÉricP source
share