6

How can I change the text of tabs on the product description page?

As currently, I am having their name as details. So I want to change it as highlights.

file path where and how can I change it?

EDIT Code of Ultimo Catalog_product_view.xml

<?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"> 
--> 
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> 
<body> 
<referenceContainer name="content" > 
<!-- <block class="Magento\Catalog\Block\Product\View\Attributes" template="Magento_Catalog::product/view/topattributes.phtml" name="product.info.topattribute" after="product.info.media"> 
</block>  -->
<block class="Infortis\Base\Block\Product\View" name="product-view-wrapper" template="product/view.phtml" before="-"> </block> 
<container name="container_product_image_1" label="Product View, Image Column" /> 
<container name="container_product_primary_1" label="Product View, Primary Column, Container 1" /> 
<container name="container_product_primary_2" label="Product View, Primary Column, Container 2" /> 
<container name="container_product_secondary_1" label="Product View, Secondary Column, Container 1" /> 
<container name="container_product_secondary_2" label="Product View, Secondary Column, Container 2" /> 
<container name="container_product_lower_primary_1" label="Product View, Lower Primary Column, Container 1" /> 
<container name="container_product_lower_primary_2" label="Product View, Lower Primary Column, Container 2" /> 
<container name="container_product_lower_secondary_1" label="Product View, Lower Secondary Column, Container 1" /> 
<container name="container_product_lower_secondary_2" label="Product View, Lower Secondary Column, Container 2" /> 
<!-- Static blocks --> 



<block class="Magento\Cms\Block\Block" name="block_product_secondary_bottom"> 
<arguments> 
<argument name="block_id" xsi:type="string">block_product_secondary_bottom</argument> 
</arguments> 
</block> 
</referenceContainer> 
<!-- Reset attributes of main containers --> 
<referenceContainer name="product.info.main" htmlTag="" htmlClass="" before="-" /> 
<referenceContainer name="product.info.media" htmlTag="" htmlClass="" after="product.info.main" /> 
<!-- Insert product view blocks into the new product view wrapper --> 
<move element="product.info.main" destination="product-view-wrapper" /> 
<move element="product.info.media" destination="product-view-wrapper" /> 
<move element="bundle.options.container" destination="product-view-wrapper" /> 
<move element="product.info.details" destination="product-view-wrapper" /> 
<move element="catalog.product.related" destination="product-view-wrapper" /> 
<move element="product.info.upsell" destination="product-view-wrapper" /> 

<!-- Move some blocks to new positions --> 
<!-- <move element="product.info.stock.sku" destination="product.info.price" after="product.price.final" /> --> 
<!-- <move element="product.info.social" destination="product.info.main" after="-" /> --> 
<move element="product.info.overview" destination="product.info.main" before="product.info.price" /> 
<move element="container_product_primary_1" destination="product.info.main" after="page.main.title" /> 
<move element="container_product_primary_2" destination="product.info.main" after="-" /> 
<!-- Move some blocks outside the "product.info.main" to manipulate their position inside template file --> 
<move element="product.info.weight" destination="product-view-wrapper" before="product.info.review" />
<move element="page.main.title" destination="product-view-wrapper" /> 
<move element="product.info.review" destination="product-view-wrapper" /> 
<!-- Product collateral data (tabs) --> 
<referenceBlock name="product.info.details" template="Infortis_Base::product/view/details.phtml" > <arguments> 
<argument translate="true" name="title" xsi:type="string">Kit Components</argument> 
<argument name="show_tabs" xsi:type="helper" helper="Infortis\Base\Helper\Template\Catalog\Product\View::showTabs" /> 
</arguments> 
<!-- Custom static blocks as tabs --> 
<block class="Magento\Cms\Block\Block" name="product_cms_block1" group="detailed_info"> 
<arguments> 
<argument name="block_id" xsi:type="string">block_product_tab1</argument> 
<argument name="title" xsi:type="helper" helper="Infortis\Base\Helper\Template\Catalog\Product\View::getStaticBlockTitle"> 
<param name="id">block_product_tab1</param> 
</argument> 
</arguments> 
</block> 
<block class="Magento\Cms\Block\Block" name="product_cms_block2" group="detailed_info"> 
<arguments> 
<argument name="block_id" xsi:type="string">block_product_tab2</argument> 
<argument name="title" xsi:type="helper" helper="Infortis\Base\Helper\Template\Catalog\Product\View::getStaticBlockTitle"> 
<param name="id">block_product_tab2</param> 
</argument> 
</arguments> 
</block> 
</referenceBlock> 
<referenceBlock name="catalog.product.related" > 
<action method="setTemplate"> 
<argument name="template" xsi:type="helper" helper="Infortis\Base\Helper\Template\Catalog\Product\View::getRelatedProductsTemplate" /> 
</action> 
</referenceBlock> 
<referenceBlock name="product.info.upsell" hide="true"> 
<action method="setTemplate"> 
<argument name="template" xsi:type="helper" helper="Infortis\Base\Helper\Template\Catalog\Product\View::getUpsellProductsTemplate" /> 
<!-- TODO: --> 
<argument name="is_responsive" xsi:type="string">false</argument> 
<argument name="show_items" xsi:type="string">3</argument> 
</action> 
</referenceBlock> 
<referenceBlock name="checkout.cart.crosssell" hide="true"> 
<action method="setTemplate"> 
<argument name="template" xsi:type="string">Infortis_Base::product/list/slider.phtml</argument> 
</action> 
</referenceBlock> 
<referenceContainer name="product.info.main">
        <block class="Magento\Catalog\Block\Product\View\Attributes" template="Magento_Catalog::product/view/topattributes.phtml" name="product.info.topattribute"  after="product.info.main"/>      
</referenceContainer>
<move element="reviews.tab" destination="main.content" after="-"/>
</body> 
</page>
  • Did you get the solution – Manoj Deswal Sep 28 '17 at 15:02
  • @ManojDeswal as ultiomo already overide it . So unable to change in override . But In vendor its changing . code of ultimo catalog_product_view.xml I have posted . – Learner Sep 28 '17 at 15:03
  • wait let me see , I hope I have answer for this and that would work for you – Manoj Deswal Sep 28 '17 at 15:06
  • 1
    try solution , and let me know if any problem .... no need to extend anything ... just add the given code and it should work – Manoj Deswal Sep 28 '17 at 15:14
7

Open your ULTIMO catalog_product_view.xml

/app/design/frontend/Infortis/base/Magento_Catalog/layout/catalog_product_view.xml

And add this code in the end of you XML file before body tag

After this <move element="reviews.tab" destination="main.content" after="-"/>

<referenceBlock name="product.info.description">
    <action method="setTitle">
        <argument name="title" xsi:type="string">Highlights</argument>
    </action>
</referenceBlock>

Keep Cache disabled or flush your cache

4

Inside

Magento2\vendor\magento\module-catalog\view\frontend\layout\catalog_product_view.xml

Note: Override this XML file in your Theme directory.

app/design/frontend/Package/theme/Magento_Catalog/layout/catalog_product_view.xml

1st Way

Find Below code to change the title

<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="product/view/details.phtml" after="product.info.media">
    <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" template="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="product/view/attributes.phtml" group="detailed_info">
        <arguments>
            <argument translate="true" name="title" xsi:type="string">More Information</argument>
        </arguments>
    </block>
</block>

Add above code inside <referenceContainer name="content"> and change the title. It will fix your issue.

2nd way: add below code inside catalog_product_view.xml file

<referenceBlock name="product.info.description">
    <action method="setTitle">
        <argument name="title" xsi:type="string">Highlights</argument>
    </action>
</referenceBlock>
  • I need to change just last argument ? mean last line ? – Learner Sep 28 '17 at 14:47
  • yes, <argument name="title" translate="true" xsi:type="string">highlights</argument> – Abhishek Panchal Sep 28 '17 at 14:49
  • I am using a theme ultimo , And there is already a file with same name .And there is no code like this . So how to override this now ? As I change in vendor and it worked for me . – Learner Sep 28 '17 at 14:53
  • can you please add the code of catalog_product_view.xml file of Ultimo theme? So that i can show you where to add it. Also please check my updated answer – Abhishek Panchal Sep 28 '17 at 14:55
  • As I tried in code to change strings as well so you can see in code . Updated code kindly check – Learner Sep 28 '17 at 15:00
3

Abhishek's code is working fine. If you want add more tab use below code and this in

app/design/frontend/Package/theme/Magento_Catalog/layout/catalog_product_view.xml

<block class="Magento\Catalog\Block\Product\View\Description" name="Yourcustom.tab" template="product/view/Yourcustom.phtml" group="detailed_info">
    <arguments>                                              
        <argument translate="true" name="title" xsi:type="string">Your custom tab name here</argument>  
    </arguments>
</block>

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.