I am using new product
widget in my custom phtml template. It is showing the newly products. but i want to add the date filter to this products. How can i do it. Any help appreciated.
template file code:
<?php echo $this->getLayout()->createBlock("Magento\Catalog\Block\Product\Widget\NewWidget")->setDisplayType("new_products")->setProductsCount("20")->setTemplate("product/widget/new/content/new_grid.phtml")->toHtml(); ?>
I have added from and To date fields in
product/widget/new/content/new_grid.phtml template but I don't know how to pass this dates to function and get filtered results. Thanks in advance. Any help appreciated.