There is no abilitity to add a tab to product page at a desired position
Preconditions
Magento 2.2
Steps to reproduce
Try to change the position of a tab on a product page in the code
Expected result
Obviously, most store owners would like to have an ability to change the order of any tab on a product page. For example, they would prefer to make "Description" tab appearing first always, regardless names of modules that add tabs to a product page.
Actual result
There is no normal way to change an order of tabs on Magento 2 storefront on a product page. Magento2 just loads tabs from A to Z by its module name. So, if there is a module with A_modulename name, then its tab will appear first (before the Description tab).
Same issue here - we also tried repositioning with after/before other tabs within the xml and it's not working either.
any updates on this?
Hi @stasleo ! Thank you for reporting this issue. Internal MAGETWO-53105 ticket has been created.
I got the temporary solution that use sequence module in your xml:
<module name='Your_Module' setup_version='2.0.0'>
<sequence>
<!-- Your tab will be added on the last place -->
<module name='Magento_Review'/>
</sequence>
</module>
Anything new on this? Kind of a bummer.
Thank you for your submission.
We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues.
Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here).
We are closing this GitHub ticket and have moved your request to the new forum.
I don't believe this is a new feature request and is indeed a bug, can we re-open please.
I believe this is a bug as the block & template that drives the product descriptions should respect the layout ordering (after & before) but in actual fact it just renders the tabs in the order their respected modules are loaded. This means plugins or hacks are required to re-order the tabs, even though they're controlled by the layout system.
The implementation of tabs are as follows within catalog_product_view.xml:
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="Magento_Catalog::product/view/details.phtml" after="product.info.media">
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" as="description" template="Magento_Catalog::product/view/attribute.phtml" group="detailed_info">
<arguments>
<argument name="at_call" xsi:type="string">getDescription</argument>
<argument name="at_code" xsi:type="string">description</argument>
<argument name="css_class" xsi:type="string">description</argument>
<argument name="at_label" xsi:type="string">none</argument>
<argument name="title" translate="true" xsi:type="string">Details</argument>
</arguments>
</block>
<block class="Magento\Catalog\Block\Product\View\Attributes" name="product.attributes" as="additional" template="Magento_Catalog::product/view/attributes.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">More Information</argument>
</arguments>
</block>
</block>
Any block added within the product.info.details block will not respect the layout XML order.
@stasleo, thank you for your report. We've acknowledged the issue and added to our backlog.
Hi @vasilii-b. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:
-
[ ] 1. Add/Edit
Component: XXXXXlabel(s) to the ticket, indicating the components it may be related to. -
[ ] 2. Verify that the issue is reproducible on
2.3-developbranchDetails
- Add the comment@magento-engcom-team give me 2.3-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.3-developbranch, please, add the labelReproduced on 2.3.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
-
[ ] 3. Verify that the issue is reproducible on
2.2-developbranch.Details
- Add the comment@magento-engcom-team give me 2.2-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.2-developbranch, please add the labelReproduced on 2.2.x -
[ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.
Hi @stasleo. Thank you for your report. The issue has been fixed in magento/magento2#19007 by @vasilii-b in 2.3-develop branch Related commit(s):
- c91649a8ef2e7f9d50aedead338537afd7b89401
- c1d0f31d6be809083f2dc31a73ea52eae1f740b8
- 1ad7d4598504fe89b2f0899a966f61fbdf5c64d5
The fix will be available with the upcoming 2.3.1 release.