2

I want to add two new custom tabs on product view page first one is added but when i add second tab i got error. "product.category" is not a child of "product.info.details". Resolve the issue and try again.

catalog_product_views.xml

 <referenceBlock name="product.info.details"> <block class="vendor\Module\Block\BlockName" name="products.tab" template="Vendor_Module::first.phtml" group="detailed_info"> <arguments> <argument translate="true" name="title" xsi:type="string">Custom tab 1</argument> <argument name="sort_order" xsi:type="string">200</argument> </arguments> </block> <block class="vendor\Module\Block\BlockName" name="product.category" as="additional" after="products.tab" template="Vendor_Module::second.phtml" group="detailed_info"> <arguments> <argument translate="true" name="title" xsi:type="string">Custom tab2</argument> <argument name="sort_order" xsi:type="string">220</argument> </arguments> </block> </referenceBlock> 

1 Answer 1

2

You need to remove after="products.tab".

<referenceBlock name="product.info.details"> <block class="vendor\Module\Block\BlockName" name="products.tab" template="Vendor_Module::first.phtml" group="detailed_info"> <arguments> <argument translate="true" name="title" xsi:type="string">Custom tab 1</argument> <argument name="sort_order" xsi:type="string">200</argument> </arguments> </block> <block class="vendor\Module\Block\BlockName" name="product.category" as="additional" template="Vendor_Module::second.phtml" group="detailed_info"> <arguments> <argument translate="true" name="title" xsi:type="string">Custom tab2</argument> <argument name="sort_order" xsi:type="string">220</argument> </arguments> </block> </referenceBlock> 
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.