I have a category named NEW and I want to show all new products in this category (filter by Set Product as New From To attribute), how can I do that?

Thank you.

  • Can you show anything that you've tried? Oct 17, 2017 at 11:27
  • I have copy list.phtml file then rename it then call it on new category then try to fetch like $todayDate = date('Y-m-d', time()); $_productCollection->addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate));
    – Bhavesh
    Oct 17, 2017 at 11:32

2 Answers 2

  1. Create a new static block from admin.
  2. Insert widget in a static block.
  3. Select Catalog New Products List in widget type.

OR you can simply paste below code in your static block content

<p>{{widget type="Magento\Catalog\Block\Product\Widget\NewWidget" display_type="all_products" products_count="10" template="product/widget/new/content/new_grid.phtml"}}</p>
  1. Go to your New category > Display mode and set Static block only.
  2. Go to your New category > Content and Add CMS Block which we have created in step 1.

Even though the answer is older, I am currently facing the same problem. However, I do not want to display the products as a block but normally in the layered navigation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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