2

I already created new custom tab using this tutorial: https://magenticians.com/add-custom-tab-magento-2/

But it is located on left side. I need to place it at end (right side) like it is on this picture: https://i.sstatic.net/Stqen.png

I should be using move element like it is mentioned in this manual: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html

But I don't know how to do this.

Please help me.

2 Answers 2

0

You can give TAB'S priority(position) like below:

    <referenceBlock name="product.info.details">
        <referenceBlock name="product.info.description">
            <arguments>
                <argument name="priority" xsi:type="string">1</argument>.  <!-- you can pass position here -->
            </arguments>
        </referenceBlock>
        <referenceBlock name="product.attributes">
            <arguments>
                <argument name="priority" xsi:type="string">3</argument>
            </arguments>
        </referenceBlock>
        <referenceBlock name="reviews.tab">
            <arguments>
                <argument name="priority" xsi:type="string">4</argument>
            </arguments>
        </referenceBlock>
        <!-- MY OWN CUSTOM BLOCK ON THE SECOND POSITION -->
        <block class="Magento\Catalog\Block\Product\View\Description" name="product.features" as="features" template="product/view/features.phtml" group="detailed_info">
            <arguments>
                <argument translate="true" name="title" xsi:type="string">Features</argument>
                <argument name="priority" xsi:type="string">2</argument>
            </arguments>
        </block>
        <!-- MY OWN CUSTOM BLOCK ENDS HERE -->
    </referenceBlock>
0

Note that for more recent versions of Magento 2 (2.3.1 onwards) you need to add the new argument in your catalog_module_view.xml for each custom tab.

<argument name="sort_order" xsi:type="string">2</argument>

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.