magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

There is no abilitity to add a tab to product page at a desired position

Open stasleo opened this issue 10 years ago • 10 comments

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).

stasleo avatar Apr 14 '16 14:04 stasleo

Same issue here - we also tried repositioning with after/before other tabs within the xml and it's not working either.

devhn avatar Apr 14 '16 14:04 devhn

any updates on this?

stasleo avatar May 18 '16 09:05 stasleo

Hi @stasleo ! Thank you for reporting this issue. Internal MAGETWO-53105 ticket has been created.

MomotenkoNatalia avatar May 19 '16 15:05 MomotenkoNatalia

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>

davidnguyen2205 avatar May 25 '16 17:05 davidnguyen2205

Anything new on this? Kind of a bummer.

jarhody avatar Jul 22 '16 19:07 jarhody

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.

piotrekkaminski avatar Aug 30 '16 19:08 piotrekkaminski

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.

davemacaulay avatar Aug 07 '18 10:08 davemacaulay

@stasleo, thank you for your report. We've acknowledged the issue and added to our backlog.

ghost avatar Aug 22 '18 12:08 ghost

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: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced 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-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

magento-engcom-team avatar Oct 30 '18 12:10 magento-engcom-team

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):

The fix will be available with the upcoming 2.3.1 release.

magento-engcom-team avatar Jan 19 '19 06:01 magento-engcom-team