Question

How to Add Product Specification Section Under Product Info in Magento 2

enter image description here

Was it helpful?

Solution

first you need to add catalog_product_view.xml file here in this path in your theme

app/design/frontend/Vendor/Theme/Magento_Catalog/layout/catalog_product_view.xml

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Magento\Catalog\Block\Product\View" name="product.info.specification" template="Magento_Catalog::product/view/product-specification.phtml"/>
        </referenceContainer>
        <move element="product.info.specification" destination="product.info.main" after="product.info" />
    </body>
</page>

you need to create one template file here and call here custom product specification attributes

app/design/frontend/Vendor/Theme/Magento_Catalog/templates/product/view/product-specification.phtml

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/** @var $block \Magento\Catalog\Block\Product\View */
?>
<?php $_product = $block->getProduct(); ?>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top