I'm using magento2.4.2 and added catalog widget in homepage.Need to add datalayer to addtocart event in MagentoCatalogWidgets. Note:Add to cart event for listing and detail pages are working perfectly
1 Answer
the first thing to understand with widget is that the template they use can be configured differently from the pagebuilder, on the screenshot below, we can see the template is: Magento_CatalogWidget::product/widget/content/grid.phtml
(full path: vendor/magento/module-catalog-widget/view/frontend/templates/product/widget/content/grid.phtml
)
To customise this template, we know we may add a new file in the folder app/design/frontend/Vendor/ThemeName/Magento_CatalogWidget/product/widget/content/grid.phtml
Once we have this template in the right place, then adding datalayer feature will lead to have the same changes as what was done on other templates.
-
Im using enterprise,so for all other templates that was added by default ..but not in widget Aug 17, 2022 at 14:56
-