I'm using the following code in my magento store to have a few new products on the main page of the store.

{{widget type="catalog/product_widget_new" display_type="all_products" products_count="6"
  column_count="6" cache_lifetime="1" template="catalog/product/widget/new/content/new_grid.phtml"}}

The annoying part is that I have 3 "magical" products (old as hell) stuck in this widget. No matter what, they continue to be there. This widget is for new products, so it should show only the most recent products added to the store, right?


You are right, it should sort all products by creation date. This is the code used for display_type="all_products":

    $collection = $this->_addProductAttributesAndPrices($collection)
        ->addAttributeToSort('created_at', 'desc')

This means, your magically stuck products seem to have a creation date in the future. You can only change it directly in the catalog_product_entity database table.

| improve this answer | |

try to use this code: {{widget type="catalog/product_widget_new" display_type="new_products" products_count="40" template="catalog/product/widget/new/content/new_grid.phtml"}}

| improve this answer | |
  • in products count = "40" template ... use the number of products you want to display. – Dellatorre Oct 27 '15 at 0:38
  • Thanks for the help, but what I really want are the recently added products. So that's why "all_products". I work around this by duplicate those products and delete the old ones. – Jóni Oct 27 '15 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.