2

For SEO reason I would like to move the product attributes from "More info" Tab to details.

I could move them above and under the price info, but I want to move them below description (main content)

<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="mage/gallery/gallery.css" media="all"/>
</head>
<body>
    <move element="page.main.title"             destination="product.info.price" before="product.price.final"/>
    <move element="product.info.review"         destination="product.info.price" after="page.main.title"/>
    <move element="product.info.overview"       destination="product.info.price" after="product.info.review"/>
    <move element="product.info.mailto"         destination="product.info.addto" after="view.addto.compare"/>
    <move element="product.attributes"         destination="product.info.details" after="product.info.description"/>
</body>

3 Answers 3

1

Update file app/design/frontend/Vendor/Theme/Magento_Catalog/layout/catalog_product_view.xml of your theme and add following code inside <body> node:

<move element="product.attributes" destination="content" after="-" />

It will move attributes visible in More Information tab to product details section and will be shown below product details.

1

In your theme u have to override Magento Default files.

magento\app\design\frontend\Custom\YourTheme\Magento_Catalog\layout\catalog_product_view.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 SW-THEMES. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="Magento_Catalog::js/jquery.zoom.min.js"/>
    </head>
    <body>
        <referenceBlock name="product.attributes" remove="true"/>
    </body>
</page>

magento\app\design\frontend\Custom\YourTheme\Magento_Catalog‌​\templates\product\v‌​iew\attribute.phtml as per your requirement.

<?php
    /**
    * Copyright © 2016 Magento. All rights reserved.
    * See COPYING.txt for license details.
    */
?>
<?php
    $_helper = $this->helper('Magento\Catalog\Helper\Output');
    $_product = $block->getProduct();
    $_call = $block->getAtCall();
    $_code = $block->getAtCode();
    $_className = $block->getCssClass();
    $_attributeLabel = $block->getAtLabel();
    $_attributeType = $block->getAtType();
    $_attributeAddAttribute = $block->getAddAttribute();

    if ($_attributeLabel && $_attributeLabel == 'default') {
        $_attributeLabel = $_product->getResource()->getAttribute($_code)->getFrontendLabel();
    }
    if ($_attributeType && $_attributeType == 'text') {
        $_attributeValue = ($_helper->productAttribute($_product, $_product->$_call(), $_code)) ? $_product->getAttributeText($_code) : '';
    } else {
        $_attributeValue = $_helper->productAttribute($_product, $_product->$_call(), $_code);
    }

    $colorValue = $_product->getResource()->getAttribute('color')->getFrontend()->getValue($_product);

?>
<?php if ($colorValue): ?>
    <div><?php echo $colorValue; ?></div>
<?php endif; ?>

<?php if ($_attributeValue): ?>
<div class="product attribute <?php /* @escapeNotVerified */ echo $_className?>">
    <?php if ($_attributeLabel != 'none'): ?><strong class="type"><?php /* @escapeNotVerified */ echo $_attributeLabel?></strong><?php endif; ?>
    <div class="value" <?php /* @escapeNotVerified */ echo $_attributeAddAttribute;?>><?php /* @escapeNotVerified */ echo $_attributeValue; ?></div>
</div>
<?php endif; ?>
0

add this code in Magento_Catalog/layout/catalog_product_view.xml and add element name in after="" where you want to move..

<move element="product.attributes" destination="content" after="-" />

clear cache and check.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.