Add Specifications for products in magento

Add Specifications for products in magento

October 16, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Add Specifications for products in magento

How to Add Product Specifications in Magento

As an experienced developer, I frequently encounter requests from clients who want to display detailed product specifications on their Magento storefronts. This blog post will guide you through the process of adding specifications for your products right from the Magento backend.

Understanding the Requirements

The client provided a list of specifications and dimensions they want to show for each product. Their current setup does not have this functionality built-in, so we’ll need to create custom attributes and a frontend template to display them.

Creating Custom Attributes in Magento Backend

  1. Navigate to the Catalog > Attributes section.

  2. Click on “Add New Attribute” at the top right corner of the page.

  3. Enter the following details for your new attribute:

    • Attribute Code: product_specification
    • Scope: Global
    • Data Type: Text Area (for multi-line specifications)
    • Default Value: Leave this blank
    • Used in Product Listing: Checked
    • Used in Search Results Layered Navigation: Checked
  4. Click “Save Attribute.”

Now you have a new attribute called product_specification that will store the product’s specifications in the backend.

Adding Specifications for a Product

  1. Navigate to your desired product page (Catalog > Manage Products).

  2. Select your product and click on it to open the edit mode.

  3. Scroll down to the “Custom Design” section on the left side menu.

  4. Expand the “Product Specification” attribute group you just created.

  5. Paste or type in your specification details using HTML markup (as provided by the client).

  6. Click “Save Product.”

Displaying Specifications on the Frontend

To display these specifications on the frontend, we need to modify the product view template.

  1. Locate the catalog_product_view.xml file under the theme you are working with:

    • For default Magento themes: /app/design/frontend/<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml
    • For third-party themes: Usually in the same path, but check your theme documentation for specific locations.
  2. Add the following code inside the <body> tag:

<block class="Magento\Framework\View\Element\Template" template="Magento_Catalog::product/view/attributes.phtml" name="catalog.product.view.attributes" as="additional"/>
  1. Create or modify the attributes.phtml file in your theme (same path as above):

    • Add a new variable to get the specifications attribute:
      $product = $block->getProduct();
      $specifications = $product->getData('product_specification');
      
  2. Add an HTML structure and loop through the specifications:

<?php if ($specifications): ?>
    <div class="product-specs">
        <h2>Specifications</h2>
        <?= nl2br($specifications); ?>
    </div>
<?php endif; ?>

<div class="product-dimensions">
    <h2>Dimensions</h2>
    <!-- Add your dimensions HTML here -->
</div>
  1. Clear Magento cache (System > Cache Management) to see the changes on the frontend.

Conclusion

By following these steps, you now know how to add and display product specifications in Magento effectively. This approach allows for a clean separation of data and presentation logic, making your store more informative and user-friendly.

Remember that customizing Magento themes requires a basic understanding of XML layout update files and PHP views. If you’re new to Magento development, consider browsing our blog posts on Magento theme customization basics for further guidance.

Happy coding!

Catalog Themes Admin CLI

Our network