Magento - show a single product in homepage

Magento - show a single product in homepage

September 14, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento - show a single product in homepage

Displaying a Single Product on Magento Homepage

If you want to showcase a single product prominently on your Magento homepage, here’s a step-by-step guide to achieve this with precision.

Understanding the Requirement

We are tasked with displaying only one specific product on the homepage, including its name, an image, and its price. To accomplish this, we’ll need to modify the home page layout file and use Magento’s product collection to fetch the desired item.

Step 1: Identify Your Product

Firstly, ensure you have identified the exact product you want to display. Let’s assume it has the SKU unique-product.

Step 2: Modify the Homepage Layout

Open your theme’s app/design/frontend/{package}/{theme}/Magento_Theme/layout/default.xml file or create it if it doesn’t exist.

Add the following code within the <body> tag, replacing {product_id} with the ID of your desired product:

<referenceContainer name="content">
    <block class="Magento\Catalog\Block\Product\View" template="catalog/product/view.phtml" name="unique-product-block">
        <arguments>
            <argument name="data" xsi:type="array">
                <item name="id" xsi:type="string">{product_id}</item>
            </argument>
        </arguments>
    </block>
</referenceContainer>

Step 3: Modify the View Template

Now, let’s customize the product view template. Copy vendor/magento/module-catalog/view/frontend/templates/product/view.phtml to your theme directory at app/design/frontend/{package}/{theme}/Magento_Catalog/templates/product/view.phtml.

Open this copied file and locate the line containing <div class="product-name">. Replace it with:

<div class="product-name">
    <h1 class="page-title"><?= $block->getProduct()->getName() ?></h1>
</div>

Next, find the line that starts a div with the product-image-wrapper class and replace it with this code to display only one image:

<div class="product-image-wrapper">
    <?= $block->getProduct()->getImage('image', 'product_page_image_large') ?>
</div>

Finally, locate the price-box container and modify it like so:

<dl class="price-box">
    <dt><?= /* @escapeNotVerified */ __('Price:') ?></dt>
    <dd class="price">
        <?= $block->getProduct()->getFinalPrice() ?>
    </dd>
</dl>

Step 4: Refresh Your Cache and Check

After saving your changes, clear your Magento cache either manually or using the command php bin/magento cache:flush. Then, navigate to your Magento store’s homepage.

You should now see a single product with its name, image, and price prominently displayed. This approach ensures that only the specified product is shown and maintains the clean, uncluttered look you’re aiming for.

Remember, always backup your files before making changes and ensure your theme is set to be used in the Magento configuration under Content > Design.

For more advanced customizations or if you need help with other Magento development tasks, feel free to explore our services at Laravel Company.

Catalog Extensions Themes Pricing

Our network