1

How to show information (Shipping rates,Report an issue,Questions and Returns) in product details page tabs.It shows only Details,More information tabs.

Is there any back-end configuration available to add custom tabs with custom information?

0

1 Answer 1

1

You can add Custom tab with product/custom information, this may not be possible by admin configuration.

You need to create a custom module by following below steps.assume you know how to create a module, as i am not adding entire structure.

app\code\Vendor\Module\view\frontend\layout\catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <body>
      <referenceBlock name="product.info.details">
          <block class="Vendor\Module\Block\Customtab" name="example.tab" template="Vendor_Module::customtab.phtml" group="detailed_info">
              <arguments>
                  <argument translate="true" name="title" xsi:type="string">Your Title</argument>
              </arguments>
          </block>
      </referenceBlock>
   </body>
</page>

Create a template app\code\Vendor\Module\view\frontend\templates\customtab.phtml

<h1>My custom tab info</h1>

Create a block and render the required details.

Remove the cache and check the new tab in details page.

3
  • In catalog_product_view.xml page whatever i want the tabs are there.How to enable it
    – User0434
    Commented Sep 26, 2016 at 9:43
  • How can I add more than one tabs in catalog_product_view.xml?
    – Omer
    Commented Jun 6, 2017 at 21:04
  • Hi @Omer, have u got any solution for adding two tabs? Commented Aug 12, 2019 at 10:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.