0

How can I add new tabs in Luma theme to show more information about created attributes?

In the small description in the Italian view I leave the string "none", with code inspection the class is "type".

I tried to change the text of the product in the Italian view but it does not work.

Please help me.

enter image description here

enter image description here

  • What do you want to show in the tab? – harri Jul 26 '17 at 12:30
  • Do you want to show custom attribute value in tab ? – Pawan Jul 26 '17 at 17:22
  • The attributes created in Stores / Attributes / Product should be on the board and inserted into the attribute set – Alessandro Jul 26 '17 at 17:54
0

Assuming you want to add a static block to hold the additional information about created attributes you can use below code:

<?xml version="1.0"?>
<page layout="1column" 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="Magento\Cms\Block\Block" name="additionalinfo.tab" as="additionalinfo" group="detailed_info" >
            <arguments>
             <argument translate="true" name="title" xsi:type="string">Addtional Information</argument>
                <argument name="block_id" xsi:type="string">additionalinfo</argument>
            </arguments>
      </block>
   </referenceBlock>
</body>
</page>

This would go in your theme within file:

Magento_Catalog/layout/catalog_product_view.xml

A block will need to be created called additionalinfo and the information within here will be displayed in your tab. Similarly you can use phtml files that are shown instead of the static block.

  • What is the full path where I need to enter this code? – Alessandro Jul 27 '17 at 13:48
  • Have you got a theme? – harri Jul 27 '17 at 13:56
  • app/design/frontend/Vendor/Theme/Magento_Catalog/layout/catalog_product_view.xml – harri Jul 27 '17 at 13:57
  • after app/design/frontend/ i have only Magento folder and not Vendor. – Alessandro Jul 27 '17 at 14:26
  • Yeah so you do not have a theme. May be worth creating a theme. Within Magento is there any folders? – harri Jul 27 '17 at 14:41
0

Override catalog_product_view.xml in your module and add your block in product.info.details reference block as shown below

<?xml version="1.0"?>
<page layout="1column" 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="Path/to/Block" name="nameofblock" template="Vendor_Module::path/to/template" group="detailed_info" >
             <arguments>
                <argument translate="true" name="title" xsi:type="string">Title of the tab</argument>
             </arguments>
          </block>
        </referenceBlock>
    </body>
</page>


Feel free ask any queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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