How to change the product view page design Magento 2?

How to change the product view page design Magento 2?

July 1, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to change the product view page design Magento 2?

Changing Your Product Detail Page Design in Magento 2

Are you new to Magento 2 and struggling to customize your product detail page design? Don’t worry; with this guide, you’ll learn how to modify the look and feel of your products’ full view pages quickly.

Understanding the Default Product View Layout in Magento 2

Before we dive into customization, let’s understand the default layout structure. The catalog_product_view.xml file under app/code/Magento/Catalog/view/frontend/layout defines the initial setup for product pages.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/layout.xsd">
    <update handle="catalog_product_view"/>
</page>

This layout includes components like product.info, which contains the product attributes, product.info.description, and others.

How to Customize Your Product Detail Page

To change your product detail page design, you’ll need to create a custom theme or modify an existing one. Here’s how:

1. Create a New Theme or Modify an Existing One

  • Navigate to your Magento installation directory.
  • Create a new folder inside app/design/frontend for your theme (e.g., your_vendor/magento2-theme).

2. Duplicate the Catalog XML Layout File

  • Copy the catalog_product_view.xml file from vendor/magento/module-catalog/view/frontend/layout.
  • Paste it into your new theme folder: app/design/frontend/your_vendor/magento2-theme/Magento_Catalog/layout.

3. Modify the Product View Layout

Open the copied catalog_product_view.xml file in a text editor and make your desired changes.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/layout.xsd">
    <update handle="catalog_product_view"/>

    <!-- Add or remove layout elements here -->
  <referenceContainer name="product.info.main">
      <block class="Magento\Catalog\Block\Product\View\Description" name="product.description" template="Magento_Catalog::product/view/attribute.phtml"/>
      <block class="Magento\Catalog\Block\Product\View" name="product.addto" as="addto" template="Magento_Catalog::product/view/addto.phtml">
          <action method="setTemplate">
              <argument name="template" xsi:type="string">Magento_Theme::js/onecolumn.phtml</argument>
          </action>
      </block>
    </referenceContainer>

</page>

4. Add or Remove Layout Elements

In the above example, we’ve added a block for product descriptions and replaced the default add-to-cart template with a custom layout.

Using PHTML Templates to Customize Your Product View

You can further customize your product view by modifying the corresponding .phtml templates in Magento_Catalog/templates/product/view/attribute.phtml or Magento_Theme/templates/js/onecolumn.phtml.

To do this, follow these steps:

  • Copy the original template files into your theme.
  • Modify them using HTML, CSS, and JavaScript to achieve your desired design.

Conclusion

In this guide, you learned how to change the product view page layout in Magento 2 by creating a custom theme and modifying the XML layout file. Remember that themes are the best way to customize your store’s look without losing changes during updates.

For more advanced customizations and best practices, be sure to check out our comprehensive Magento development guide on Laravel Company.

Happy coding!

Magento 2 Catalog Extensions Themes

Our network