如何更改产品页面上“详细信息”选项卡的文本?


Answers:


10

app/design/frontend/<vendor>/<theme>/Magento_Catalog/layout/catalog_product_view_layout.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">
            <referenceBlock name="product.info.description">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">About</argument> //set your custom tab name
                </arguments>
            </referenceBlock>

            <referenceBlock name="reviews.tab">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Customer Reviews</argument> //set your custom tab name
                </arguments>
            </referenceBlock>
        </referenceBlock>

    </body>
</page>

嘿,一切正常。如何在“ vendor \ magento \ module-catalog \ view \ frontend \ layout \ catalog_product_view.xml”中找不到名称“ reviews.tab”。
Srinivasan Lakshmanan

9

打开您的自定义主题 catalog_product_view.xml

app/design/frontend/vendorname/themename/Magento_Catalog/layout/catalog_product_view.xml

XML正文末尾的文件末尾添加以下代码

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

保持禁用缓存或清除缓存


这是更改标签名称的有效解决方案和纯粹的magento方式
Manoj Deswal
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.