Magento 2 – Override Recently Viewed Widget magento2recently-viewed I have added a recently viewed widget in home page I want to remove add to cart button in the recently viewed widget. Best Answer Copy the below file to your theme: vendor/magento/module-reports/view/frontend/templates/widget/viewed/content/viewed_grid.phtml Your file location will be like below: app/design/frontend/[Vendor]/[theme]]/Magento_Reports/templates/widget/viewed/content/viewed_grid.phtml Below is the php code which you will find top of the above file: <?php if ($exist = ($block->getRecentlyViewedProducts() && $block->getRecentlyViewedProducts()->getSize())) { $type = 'widget-viewed'; $mode = 'grid'; $type = $type . '-' . $mode; $image = 'recently_viewed_products_grid_content_widget'; $title = __('Recently Viewed'); $items = $block->getRecentlyViewedProducts(); $showWishlist = true; $showCompare = true; $showCart = true; $rating = 'short'; $description = ($mode == 'list') ? true : false; } ?> You need to set $showCart = false to hide "Add to cart" button. And you can manage the contents according to your requirement. Don't forget to flush the cache. Related Solutions Related Topic
Best Answer
Copy the below file to your theme:
Your file location will be like below:
Below is the php code which you will find top of the above file:
You need to set $showCart = false to hide "Add to cart" button. And you can manage the contents according to your requirement.
Don't forget to flush the cache.