3

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.

2
  • 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

1 Answer 1

3
  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.

Your Answer

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

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