Hi , i had few tabs in product detailed page and i want to show those tabs in order like Details , Key Specifications , contents Of Package , More Information , Warranty , Reviews For reference please find the image link
Hello @sekhar_n
You can use sort_order argument in "app/design/frontend/Packagename/themename/Magento_Catalog/layout/catalog_product_view.xml" xml config file.
<referenceBlock name="product.info.description"> <arguments> <argument name="title" translate="true" xsi:type="string">Description</argument> <argument name="sort_order" xsi:type="string">30</argument> </arguments> </referenceBlock>
Also make sure to update method "getGroupChildNames" with "getGroupSortedChildNames" in template file, if you are overriding it. app/design/frontend/Packagename/themename/Magento_Catalog/templates/product/view/details.phtml.
As per Magento 2.3.1
<?php if ($detailedInfoGroup = $block->getGroupSortedChildNames('detailed_info', 'getChildHtml')):?>
Also, If you are overriding Magento\Catalog\Block\Product\View\Details.php block class then your block class should have that updated method "getGroupSortedChildNames" as well.
in my theme catalog_product_view.xml is look like
<?xml version="1.0"?>
<!--
/**
* Copyright テつゥ 2018 Porto. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="sidebar.additional">
<block class="Smartwave¥Porto¥Block¥Template" name="product_view_custom_block" before="-" template="Magento_Catalog:roduct/view/custom_block.phtml"/>
</referenceContainer>
<move element="product.info.stock.sku" destination="product.info.price" after="product.price.final"/>
<move element="product.info.review" destination="product.info.main" before="product.info.price"/>
<move element="catalog.product.related" destination="sidebar.additional" after="product_view_custom_block"/>
<!--<referenceBlock name="catalog.product.related" remove="true"/>-->
<move element="product.info.overview" destination="product.info.main" after="product.info.review"/>
<referenceContainer name="after.body.start">
<block class="Magento¥Catalog¥Block¥Product¥View" name="product_custom" template="Magento_Catalog:roduct/view/product_custom.phtml" before="-"/>
<block class="Smartwave¥Porto¥Block¥Template" name="product_view_config" after="-" template="Magento_Catalog:roduct/view/config.phtml"/>
</referenceContainer>
<referenceContainer name="columns.top">
<block class="Magento¥Catalog¥Block¥Product¥View" name="prev_next_products" template="Magento_Catalog:roduct/view/prev_next.phtml" before="-"/>
</referenceContainer>
<move element="prev_next_products" destination="product.info.main" before="-"/>
<move element="page.main.title" destination="product.info.main" before="-"/>
<referenceContainer name="product.info.social">
<block class="Smartwave¥Porto¥Block¥Template" name="product_view_addthis_links" after="-" template="Magento_Catalog:roduct/view/addthis.phtml"/>
</referenceContainer>
<referenceContainer name="content">
<block class="Smartwave¥Porto¥Block¥RickSnippet" name="rich_snippet" template="Magento_Catalog:roduct/view/rich_snippet.phtml" before="-"/>
<block class="Smartwave¥Porto¥Block¥Template" name="product_view_main_custom_block" ifconfig="porto_settings/product/main_custom_block" before="product.info.main" template="Magento_Catalog:roduct/view/main_custom_block.phtml"/>
<block class="Smartwave¥Porto¥Block¥Template" name="product_view_main_custom_block2" after="-" template="Magento_Catalog:roduct/view/main_custom_block2.phtml"/>
<block class="Smartwave¥Porto¥Block¥Template" name="product.clearer" after="product.info.media" template="Magento_Catalog:roduct/view/clearer.phtml"/>
</referenceContainer>
<move element="product_view_main_custom_block2" destination="product.info.main" after="product.info.overview"/>
<move element="product.info.main" destination="content" after="product.info.media"/>
<referenceContainer name="columns">
<block class="Smartwave¥Porto¥Block¥Template" name="side_popup" after="-" template="Magento_Catalog:roduct/view/side_popup.phtml"/>
</referenceContainer>
</body>
</page>
HI @sekhar_n ,
Please have a look into below stack solution.
https://magento.stackexchange.com/a/134231
I hope it will help you!
Hi @sekhar_n,
Also check if your custom tab is randering from admin configuration.
Admin->Store Configuration->Porto->Porto Setting Panel->Product View->Product Custom Tabs.
Then you can set order there as well. PFA.
https://www.portotheme.com/magento2/porto/documentation/
Go to Custom Tab configuration.
I hope it will help you!
Add enter order value as per your sequence or share any scheenshot of the admin custom tab, so I can check structure.
Hi @sekhar_n ,
As per your current screenshot, you can see a order column, you can add sort order there.
PFA for the reference.
Flush th cache and check.
What is default order value for Details More Information and Review Tabs?