3

I firs removed more details tab. I tried to move the reviews tab to first and then moved the details tab but it's not working.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product.attributes" remove="true"/>
        <referenceBlock name="product.info.details">
            <referenceBlock name="product.info.description">
                <arguments>
                    <argument name="priority" xsi:type="string">50</argument>
                </arguments>
            </referenceBlock>
            <referenceBlock name="reviews.tab">
                <arguments>
                    <argument name="priority" xsi:type="string">01</argument>
                </arguments>
            </referenceBlock>
        </referenceBlock>
    </body>
</page>

Reverse - reviews should be first

In the above image the review tab has to come first.

I tried changing the priority also but it didn't work.

2 Answers 2

0

you need to use sort_order instead of priority like:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product.attributes" remove="true"/>
        <referenceBlock name="product.info.description">
                <arguments>
                    <argument name="sort_order" xsi:type="string">50</argument>
                </arguments>
            </referenceBlock>
            <referenceBlock name="reviews.tab">
                <arguments>
                    <argument name="sort_order" xsi:type="string">01</argument>
                </arguments>
            </referenceBlock>
    </body>
</page>

enter image description here

6
  • for reference you can check catalog_product_view.xml for block name product.info.description
    – Pawan
    May 9, 2021 at 7:01
  • Even sort order is not working @Pawan
    – Haerriz
    May 9, 2021 at 13:08
  • You need to remove "product.info.details" reference block. I have updated code. just use my code in your XML as it is.
    – Pawan
    May 9, 2021 at 13:50
  • @Haerriz, did it worked ?
    – Pawan
    May 13, 2021 at 7:53
  • Nope it didn't work
    – Haerriz
    May 14, 2021 at 4:35
0

open [magento]\app\design\frontend\default\default\layout\catalog.xml

find and addTab

<catalog_product_view translate=""label"">

<reference name=""content"">
........
 <block type=""catalog/product_view_tabs"" name=""product.info.tabs"" as=""info_tabs"" template=""catalog/product/view/tabs.phtml"" >
        <action method=""addTab"" translate=""title"" module=""review"">                      
        <alias>review</alias>
        <title>Add Reviews</title>
        <block>review/product_view_list</block>
        <template>review/product/view/list.phtml</template>
        </action>
    </block> 
.......
</reference>

</catalog_product_view>

[magento]\app\design\frontend\default\default\template\catalog\product\view.phtml

<?php echo $this->getChildHtml('info_tabs') ?>

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.