Show recent_viewed products on product Page

Show recent_viewed products on product Page

July 16, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Show recent_viewed products on product Page

Displaying Recently Viewed Products on Magento Product Page

In Magento, the default behavior is to display recently viewed products in the right sidebar of category pages. However, if you want to show this content at the bottom of individual product pages, you’ll need to make some modifications to your theme.

Here’s a step-by-step guide to achieve this:

  1. Understanding the Default Behavior

By default, Magento uses the frontend/base/default/template/reports/product_viewed.phtml file to render the recently viewed products block in the sidebar. This is controlled by the cms_block XML layout handle.

  1. Moving the Block to the Product Page Footer

To move this content to the bottom of the product page, we need to create a new XML layout update for the product view action and reassign the block there.

  1. Creating a New Layout File

Navigate to your theme directory (usually app/design/frontend/<YourTheme>/layout). If it doesn’t exist, create a new folder named catalog_product_view.xml. Inside this file, paste the following code:

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/layoutconfig.xsd">
  <default>
    <referenceBlock name="catalog.product.view.addto" after="-" template="Magento_Reports::product/viewed.phtml"/>
  </default>
</layout>

This code tells Magento to render the product_viewed block immediately after the “Add to Cart” button on all product pages.

  1. Ensuring the Block Appears

By default, the product_viewed block is already assigned to the cms_block handle. However, we need to ensure it appears in our modified layout. Open your theme’s catalog_product_view.xml file (if it exists) and add the following line inside the <default> tag:

<referenceContainer name="content">
  <block class="Magento\Reports\Block\Product\Viewed" template="Magento_Reports::product/viewed.phtml" before="-"/>
</referenceContainer>
  1. Clear Cache

After making these changes, clear your Magento cache to ensure the updates take effect.

Remember, modifying core files is generally not recommended as it can lead to issues during upgrades. For a more robust solution, consider creating a custom theme or using an extension like Laravel Company’s Magento Customization Service for professional assistance.

  1. Conclusion

Following these steps should successfully move the recently viewed products block from the category page sidebar to the bottom of individual product pages in your Magento store. Always test thoroughly after making layout changes to ensure they don’t impact other parts of your site.

Don’t forget, if you require more complex customizations or need help with implementation, our team at Laravel Company is always ready to assist you with expert Magento development services.

Checkout Catalog Themes Configuration

Our network