How to override order of custom tabs in Magento 2.4.2
-
11-05-2021 - |
Question
With the code below, I am trying to reorder the product tabs to make FEATURES tab appear first. This doesn't take any effect even after running content deploy command.
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template"
name="product-custom.js" as="product-custom.js" template="Magento_Catalog::product/js.phtml"/>
</referenceContainer>
<body>
<!-- Create container for main product tabs -->
<referenceContainer name="page.wrapper">
<container name="custom-before-footer-container" before="before-footer-container" label="Luxury Custom - container for main tabs" htmlTag="div" htmlClass="page-before-footer">
<container name="custom-before-footer-content" label="Luxury Custom - main tabs content" htmlTag="div" htmlClass="content">
</container>
</container>
</referenceContainer>
<!-- Hide additional tabs -->
<referenceBlock name="additional-tabs" display="false" />
<!-- Move product tabs into new place -->
<move element="product.info.tabs" destination="custom-before-footer-content" before="-"/>
<referenceBlock name="product.info.features">
<arguments>
<argument name="title" translate="true" xsi:type="string">Features</argument>
<argument name="sort_order" xsi:type="string">20</argument>
</arguments>
</referenceBlock>
</body>
</page>
The picture below shows how the tabs currently appear on the product page.
Solution
Does your store use a third party theme? If yes, check its configuration setting for the order of product tabs in Magento admin itself, in the side menu bar.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange