1

I need to make some custom changes on add to cart button and item prices, in Recently Viewed Products widget. For add to cart button, i need some custom php statement, And for prices i need old price to be displayed on discounted products

I tried to make some edits on:

  • vendor\magento\module-catalog\view\frontend\templates\product\widget\viewed\sidebar.phtml

  • vendor\magento\module-catalog\view\frontend\ui_component\widget_recently_viewed.xml

  • vendor\magento\module-catalog\view\frontend\templates\product\list.phtml

and few more ...

But when i made some changes, nothing seems to appear on page. Does anyone know where i can edit these elements, so the changes will be applicable for this widget only. Thanks

[EDIT, WORKING SOLUTION]

I have found the files where i can:

edit button:

  • vendor\magento\module-catalog\view\frontend\web\template\product\addtocart-button.html

    extended to ->

  • app\design\frontend\Vendor\theme\Magento_Catalog\web\template\product\addtocart-button.html

edit item elements srtucture:

  • vendor\magento\modulecatalog\view\base\web\template\product\list\listing.html

    extended to ->

  • app\design\frontend\Vendor\theme\Magento_Catalog\web\template\product\list\listing.html

add some javascript:

  • vendor\magento\module-catalog\view\frontend\templates\product\widget\viewed\sidebar.phtml

    extended to ->

  • app\design\frontend\Vendor\theme\Magento_Catalog\templates\product\widget\viewed\sidebar.phtml

  • You can enable template path hints from admin panel and check which templates are being used, once you know that make sure you make the changes by override in your custom theme and not in the core module. – Shireen N Mar 21 '18 at 13:51
0

Check the below 2 files and make changes accordingly to the "Add to cart" button

../vendor/magento/module-reports/view/frontend/templates/widget/viewed/content/viewed_grid.phtml

../var/sites/curtmfg/dev13/vendor/magento/module-reports/view/frontend/templates/widget/viewed/content/viewed_list.phtml

  • Thanks Shireen, unfortunately this didn't help. Same when i put it in child theme extension folders – gundra Mar 21 '18 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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