Magento 2 Change order of Tabs on product page












0















I have added catalog_product_view.xml in the location app/code/design/frontend/kh/custom/Magento_Catalog/layout



Set the priority for the tabs for the product detail page, but its is not working properly.



Code is given below :



<?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.info.details">
<referenceBlock name="product.info.description">
<arguments>
<argument name="priority" xsi:type="string">4</argument>
</arguments>
</referenceBlock>
<referenceBlock name="product.attributes">
<arguments>
<argument name="priority" xsi:type="string">2</argument>
</arguments>
</referenceBlock>
<referenceBlock name="reviews.tab">
<arguments>
<argument name="priority" xsi:type="string">1</argument>
</arguments>
</referenceBlock>
<block class="KHHelloBlockHello" name="new.tab" template="KH_Hello::hello.phtml" group="detailed_info" >
<arguments>
<argument translate="true" name="title" xsi:type="string">New Tab</argument>
<argument name="priority" xsi:type="string">3</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>









share|improve this question
















bumped to the homepage by Community 8 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    I have added catalog_product_view.xml in the location app/code/design/frontend/kh/custom/Magento_Catalog/layout



    Set the priority for the tabs for the product detail page, but its is not working properly.



    Code is given below :



    <?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.info.details">
    <referenceBlock name="product.info.description">
    <arguments>
    <argument name="priority" xsi:type="string">4</argument>
    </arguments>
    </referenceBlock>
    <referenceBlock name="product.attributes">
    <arguments>
    <argument name="priority" xsi:type="string">2</argument>
    </arguments>
    </referenceBlock>
    <referenceBlock name="reviews.tab">
    <arguments>
    <argument name="priority" xsi:type="string">1</argument>
    </arguments>
    </referenceBlock>
    <block class="KHHelloBlockHello" name="new.tab" template="KH_Hello::hello.phtml" group="detailed_info" >
    <arguments>
    <argument translate="true" name="title" xsi:type="string">New Tab</argument>
    <argument name="priority" xsi:type="string">3</argument>
    </arguments>
    </block>
    </referenceBlock>
    </body>
    </page>









    share|improve this question
















    bumped to the homepage by Community 8 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      I have added catalog_product_view.xml in the location app/code/design/frontend/kh/custom/Magento_Catalog/layout



      Set the priority for the tabs for the product detail page, but its is not working properly.



      Code is given below :



      <?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.info.details">
      <referenceBlock name="product.info.description">
      <arguments>
      <argument name="priority" xsi:type="string">4</argument>
      </arguments>
      </referenceBlock>
      <referenceBlock name="product.attributes">
      <arguments>
      <argument name="priority" xsi:type="string">2</argument>
      </arguments>
      </referenceBlock>
      <referenceBlock name="reviews.tab">
      <arguments>
      <argument name="priority" xsi:type="string">1</argument>
      </arguments>
      </referenceBlock>
      <block class="KHHelloBlockHello" name="new.tab" template="KH_Hello::hello.phtml" group="detailed_info" >
      <arguments>
      <argument translate="true" name="title" xsi:type="string">New Tab</argument>
      <argument name="priority" xsi:type="string">3</argument>
      </arguments>
      </block>
      </referenceBlock>
      </body>
      </page>









      share|improve this question
















      I have added catalog_product_view.xml in the location app/code/design/frontend/kh/custom/Magento_Catalog/layout



      Set the priority for the tabs for the product detail page, but its is not working properly.



      Code is given below :



      <?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.info.details">
      <referenceBlock name="product.info.description">
      <arguments>
      <argument name="priority" xsi:type="string">4</argument>
      </arguments>
      </referenceBlock>
      <referenceBlock name="product.attributes">
      <arguments>
      <argument name="priority" xsi:type="string">2</argument>
      </arguments>
      </referenceBlock>
      <referenceBlock name="reviews.tab">
      <arguments>
      <argument name="priority" xsi:type="string">1</argument>
      </arguments>
      </referenceBlock>
      <block class="KHHelloBlockHello" name="new.tab" template="KH_Hello::hello.phtml" group="detailed_info" >
      <arguments>
      <argument translate="true" name="title" xsi:type="string">New Tab</argument>
      <argument name="priority" xsi:type="string">3</argument>
      </arguments>
      </block>
      </referenceBlock>
      </body>
      </page>






      magento2 layout product-view tabs






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 28 '18 at 14:27









      sv3n

      9,71562352




      9,71562352










      asked Nov 7 '17 at 13:53









      Kishor HaseKishor Hase

      518418




      518418





      bumped to the homepage by Community 8 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 8 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          2 Answers
          2






          active

          oldest

          votes


















          0














          Try taking that code out the product.info.details referenceBlock. This is my code which is working as intended:



          <?xml version="1.0"?>
          <!--
          /**
          * Copyright © 2013-2017 Magento, Inc. 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">
          <body>
          <!-- Reorder tabs (using "before/after" doesn't work with groups) -->
          <referenceBlock name="product.info.description">
          <arguments>
          <argument name="priority" xsi:type="string">10</argument>
          </arguments>
          </referenceBlock>
          <referenceBlock name="reviews.tab">
          <arguments>
          <argument name="priority" xsi:type="string">50</argument>
          </arguments>
          </referenceBlock>
          </body>
          </page>


          The only other difference is this code is using multiples of ten.






          share|improve this answer



















          • 1





            I used same code as you provided but no luck. I am using Magento2.2 version. If I tried to pass additional argument like <argument name="title" xsi:type="string">New Review</argument> It display title of Review tab to New Review.

            – Kishor Hase
            Nov 8 '17 at 6:18



















          0














          Moving the code out of product.info.details worked, and also applying it to a referenceBlock rather than the actual block in product.info.details. So mine now looks something like



          <referenceBlock name="product.info.details">
          <referenceBlock name="product.info.description" remove="true" />
          <block class="MagentoCatalogBlockProductView" name="custom_template.tab" before="-" template="product/view/custom_template.phtml" group="detailed_info" >
          <arguments>
          <argument translate="true" name="title" xsi:type="string">About</argument>
          </arguments>
          </block>
          <block class="MagentoCatalogBlockProductView" name="product.info.composition" after="-" template="product/view/attribute.phtml" group="detailed_info" >
          <arguments>
          <argument name="at_call" xsi:type="string">getComposition</argument>
          <argument name="at_code" xsi:type="string">composition</argument>
          <argument name="css_class" xsi:type="string">composition</argument>
          <argument name="at_label" xsi:type="string">none</argument>
          <argument translate="true" name="title" xsi:type="string">Nutrition</argument>
          </arguments>
          </block>
          </referenceBlock>

          <!-- PRIORITY WORKS HERE -->
          <referenceBlock name="custom_template.tab" template="product/view/custom_template.phtml" >
          <arguments><argument name="priority" xsi:type="string">1</argument></arguments>
          </referenceBlock>
          <referenceBlock name="product.info.composition" template="product/view/attribute.phtml" >
          <arguments><argument name="priority" xsi:type="string">2</argument></arguments>
          </referenceBlock>
          <referenceBlock name="reviews.tab">
          <arguments><argument name="priority" xsi:type="string">3</argument></arguments>
          </referenceBlock>





          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "479"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f200405%2fmagento-2-change-order-of-tabs-on-product-page%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Try taking that code out the product.info.details referenceBlock. This is my code which is working as intended:



            <?xml version="1.0"?>
            <!--
            /**
            * Copyright © 2013-2017 Magento, Inc. 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">
            <body>
            <!-- Reorder tabs (using "before/after" doesn't work with groups) -->
            <referenceBlock name="product.info.description">
            <arguments>
            <argument name="priority" xsi:type="string">10</argument>
            </arguments>
            </referenceBlock>
            <referenceBlock name="reviews.tab">
            <arguments>
            <argument name="priority" xsi:type="string">50</argument>
            </arguments>
            </referenceBlock>
            </body>
            </page>


            The only other difference is this code is using multiples of ten.






            share|improve this answer



















            • 1





              I used same code as you provided but no luck. I am using Magento2.2 version. If I tried to pass additional argument like <argument name="title" xsi:type="string">New Review</argument> It display title of Review tab to New Review.

              – Kishor Hase
              Nov 8 '17 at 6:18
















            0














            Try taking that code out the product.info.details referenceBlock. This is my code which is working as intended:



            <?xml version="1.0"?>
            <!--
            /**
            * Copyright © 2013-2017 Magento, Inc. 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">
            <body>
            <!-- Reorder tabs (using "before/after" doesn't work with groups) -->
            <referenceBlock name="product.info.description">
            <arguments>
            <argument name="priority" xsi:type="string">10</argument>
            </arguments>
            </referenceBlock>
            <referenceBlock name="reviews.tab">
            <arguments>
            <argument name="priority" xsi:type="string">50</argument>
            </arguments>
            </referenceBlock>
            </body>
            </page>


            The only other difference is this code is using multiples of ten.






            share|improve this answer



















            • 1





              I used same code as you provided but no luck. I am using Magento2.2 version. If I tried to pass additional argument like <argument name="title" xsi:type="string">New Review</argument> It display title of Review tab to New Review.

              – Kishor Hase
              Nov 8 '17 at 6:18














            0












            0








            0







            Try taking that code out the product.info.details referenceBlock. This is my code which is working as intended:



            <?xml version="1.0"?>
            <!--
            /**
            * Copyright © 2013-2017 Magento, Inc. 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">
            <body>
            <!-- Reorder tabs (using "before/after" doesn't work with groups) -->
            <referenceBlock name="product.info.description">
            <arguments>
            <argument name="priority" xsi:type="string">10</argument>
            </arguments>
            </referenceBlock>
            <referenceBlock name="reviews.tab">
            <arguments>
            <argument name="priority" xsi:type="string">50</argument>
            </arguments>
            </referenceBlock>
            </body>
            </page>


            The only other difference is this code is using multiples of ten.






            share|improve this answer













            Try taking that code out the product.info.details referenceBlock. This is my code which is working as intended:



            <?xml version="1.0"?>
            <!--
            /**
            * Copyright © 2013-2017 Magento, Inc. 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">
            <body>
            <!-- Reorder tabs (using "before/after" doesn't work with groups) -->
            <referenceBlock name="product.info.description">
            <arguments>
            <argument name="priority" xsi:type="string">10</argument>
            </arguments>
            </referenceBlock>
            <referenceBlock name="reviews.tab">
            <arguments>
            <argument name="priority" xsi:type="string">50</argument>
            </arguments>
            </referenceBlock>
            </body>
            </page>


            The only other difference is this code is using multiples of ten.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 7 '17 at 14:11









            Ben CrookBen Crook

            8,7202273




            8,7202273








            • 1





              I used same code as you provided but no luck. I am using Magento2.2 version. If I tried to pass additional argument like <argument name="title" xsi:type="string">New Review</argument> It display title of Review tab to New Review.

              – Kishor Hase
              Nov 8 '17 at 6:18














            • 1





              I used same code as you provided but no luck. I am using Magento2.2 version. If I tried to pass additional argument like <argument name="title" xsi:type="string">New Review</argument> It display title of Review tab to New Review.

              – Kishor Hase
              Nov 8 '17 at 6:18








            1




            1





            I used same code as you provided but no luck. I am using Magento2.2 version. If I tried to pass additional argument like <argument name="title" xsi:type="string">New Review</argument> It display title of Review tab to New Review.

            – Kishor Hase
            Nov 8 '17 at 6:18





            I used same code as you provided but no luck. I am using Magento2.2 version. If I tried to pass additional argument like <argument name="title" xsi:type="string">New Review</argument> It display title of Review tab to New Review.

            – Kishor Hase
            Nov 8 '17 at 6:18













            0














            Moving the code out of product.info.details worked, and also applying it to a referenceBlock rather than the actual block in product.info.details. So mine now looks something like



            <referenceBlock name="product.info.details">
            <referenceBlock name="product.info.description" remove="true" />
            <block class="MagentoCatalogBlockProductView" name="custom_template.tab" before="-" template="product/view/custom_template.phtml" group="detailed_info" >
            <arguments>
            <argument translate="true" name="title" xsi:type="string">About</argument>
            </arguments>
            </block>
            <block class="MagentoCatalogBlockProductView" name="product.info.composition" after="-" template="product/view/attribute.phtml" group="detailed_info" >
            <arguments>
            <argument name="at_call" xsi:type="string">getComposition</argument>
            <argument name="at_code" xsi:type="string">composition</argument>
            <argument name="css_class" xsi:type="string">composition</argument>
            <argument name="at_label" xsi:type="string">none</argument>
            <argument translate="true" name="title" xsi:type="string">Nutrition</argument>
            </arguments>
            </block>
            </referenceBlock>

            <!-- PRIORITY WORKS HERE -->
            <referenceBlock name="custom_template.tab" template="product/view/custom_template.phtml" >
            <arguments><argument name="priority" xsi:type="string">1</argument></arguments>
            </referenceBlock>
            <referenceBlock name="product.info.composition" template="product/view/attribute.phtml" >
            <arguments><argument name="priority" xsi:type="string">2</argument></arguments>
            </referenceBlock>
            <referenceBlock name="reviews.tab">
            <arguments><argument name="priority" xsi:type="string">3</argument></arguments>
            </referenceBlock>





            share|improve this answer




























              0














              Moving the code out of product.info.details worked, and also applying it to a referenceBlock rather than the actual block in product.info.details. So mine now looks something like



              <referenceBlock name="product.info.details">
              <referenceBlock name="product.info.description" remove="true" />
              <block class="MagentoCatalogBlockProductView" name="custom_template.tab" before="-" template="product/view/custom_template.phtml" group="detailed_info" >
              <arguments>
              <argument translate="true" name="title" xsi:type="string">About</argument>
              </arguments>
              </block>
              <block class="MagentoCatalogBlockProductView" name="product.info.composition" after="-" template="product/view/attribute.phtml" group="detailed_info" >
              <arguments>
              <argument name="at_call" xsi:type="string">getComposition</argument>
              <argument name="at_code" xsi:type="string">composition</argument>
              <argument name="css_class" xsi:type="string">composition</argument>
              <argument name="at_label" xsi:type="string">none</argument>
              <argument translate="true" name="title" xsi:type="string">Nutrition</argument>
              </arguments>
              </block>
              </referenceBlock>

              <!-- PRIORITY WORKS HERE -->
              <referenceBlock name="custom_template.tab" template="product/view/custom_template.phtml" >
              <arguments><argument name="priority" xsi:type="string">1</argument></arguments>
              </referenceBlock>
              <referenceBlock name="product.info.composition" template="product/view/attribute.phtml" >
              <arguments><argument name="priority" xsi:type="string">2</argument></arguments>
              </referenceBlock>
              <referenceBlock name="reviews.tab">
              <arguments><argument name="priority" xsi:type="string">3</argument></arguments>
              </referenceBlock>





              share|improve this answer


























                0












                0








                0







                Moving the code out of product.info.details worked, and also applying it to a referenceBlock rather than the actual block in product.info.details. So mine now looks something like



                <referenceBlock name="product.info.details">
                <referenceBlock name="product.info.description" remove="true" />
                <block class="MagentoCatalogBlockProductView" name="custom_template.tab" before="-" template="product/view/custom_template.phtml" group="detailed_info" >
                <arguments>
                <argument translate="true" name="title" xsi:type="string">About</argument>
                </arguments>
                </block>
                <block class="MagentoCatalogBlockProductView" name="product.info.composition" after="-" template="product/view/attribute.phtml" group="detailed_info" >
                <arguments>
                <argument name="at_call" xsi:type="string">getComposition</argument>
                <argument name="at_code" xsi:type="string">composition</argument>
                <argument name="css_class" xsi:type="string">composition</argument>
                <argument name="at_label" xsi:type="string">none</argument>
                <argument translate="true" name="title" xsi:type="string">Nutrition</argument>
                </arguments>
                </block>
                </referenceBlock>

                <!-- PRIORITY WORKS HERE -->
                <referenceBlock name="custom_template.tab" template="product/view/custom_template.phtml" >
                <arguments><argument name="priority" xsi:type="string">1</argument></arguments>
                </referenceBlock>
                <referenceBlock name="product.info.composition" template="product/view/attribute.phtml" >
                <arguments><argument name="priority" xsi:type="string">2</argument></arguments>
                </referenceBlock>
                <referenceBlock name="reviews.tab">
                <arguments><argument name="priority" xsi:type="string">3</argument></arguments>
                </referenceBlock>





                share|improve this answer













                Moving the code out of product.info.details worked, and also applying it to a referenceBlock rather than the actual block in product.info.details. So mine now looks something like



                <referenceBlock name="product.info.details">
                <referenceBlock name="product.info.description" remove="true" />
                <block class="MagentoCatalogBlockProductView" name="custom_template.tab" before="-" template="product/view/custom_template.phtml" group="detailed_info" >
                <arguments>
                <argument translate="true" name="title" xsi:type="string">About</argument>
                </arguments>
                </block>
                <block class="MagentoCatalogBlockProductView" name="product.info.composition" after="-" template="product/view/attribute.phtml" group="detailed_info" >
                <arguments>
                <argument name="at_call" xsi:type="string">getComposition</argument>
                <argument name="at_code" xsi:type="string">composition</argument>
                <argument name="css_class" xsi:type="string">composition</argument>
                <argument name="at_label" xsi:type="string">none</argument>
                <argument translate="true" name="title" xsi:type="string">Nutrition</argument>
                </arguments>
                </block>
                </referenceBlock>

                <!-- PRIORITY WORKS HERE -->
                <referenceBlock name="custom_template.tab" template="product/view/custom_template.phtml" >
                <arguments><argument name="priority" xsi:type="string">1</argument></arguments>
                </referenceBlock>
                <referenceBlock name="product.info.composition" template="product/view/attribute.phtml" >
                <arguments><argument name="priority" xsi:type="string">2</argument></arguments>
                </referenceBlock>
                <referenceBlock name="reviews.tab">
                <arguments><argument name="priority" xsi:type="string">3</argument></arguments>
                </referenceBlock>






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 4 '18 at 14:08









                00-BBB00-BBB

                1011




                1011






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f200405%2fmagento-2-change-order-of-tabs-on-product-page%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    what is the purpose of having a “thru cal” on RF PCB?

                    What does Gandalf whisper to the Moth on the Orthanc in Isengard?

                    magento2 creating a lot of catalogrule_product_temp tables