I have overwritten the _beforeToHtml()
method in the class Magento\CatalogWidget\Block\Product\ProductsList
. After doing this, I received the following error:
Invalid template file: 'product/widget/content/grid.phtml' in module: 'My_Module'
When I move the product/widget/content/grid.phtml
template from my theme to my module, the error message dissapears. When I add the Magento_CatalogWidget::
prefix to the template in widgets.xml, the error doesn't go away.
product/widget/content/grid.phtml
?My/Theme/Magento/Catalog/templates/product/widget/content/grid.phtml
, but now I am forced to place it inMy/Module/view/frontend/templates/product/widget/content/grid.phtml