首页>Magento>source

如何在xml布局文件中使用 overwrite the Details tab title on the product details page?的参数   我希望覆盖的布局文件是:vendor / magento / module-catalog / view / frontend / layout / catalog_product_view.xml 文件中的块是:

最新回答
  • 2019-12-5
    1 #

    app/design/frontend/[Package]/[Yourtheme]/Magento_Catalog/layout/catalog_product_view.xml

    <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceBlock name="product.info.details">                
                <referenceBlock name="product.info.description">
                    <arguments>
                        <argument name="title" translate="true" xsi:type="string">Description</argument>
                    </arguments>
                </referenceBlock>
            </referenceBlock>
        </body>
    </page>
    

    如果要添加新选项卡,即属性how_to_use:

    <block class="Magento\Catalog\Block\Product\View\Attributes" name="product.info.how_to_use" template="product/view/attribute.phtml" group="detailed_info">
                <arguments>
                    <argument name="at_call" xsi:type="string">getHowToUse</argument>
                    <argument name="at_code" xsi:type="string">how_to_use</argument>
                    <argument name="css_class" xsi:type="string">details-how-to-use</argument>
                    <argument name="at_label" xsi:type="string">none</argument>
                    <argument name="title" translate="true" xsi:type="string">How to use</argument>
                </arguments>
            </block>
    

  • 2019-12-5
    2 #

    在自定义布局文件中,您可以调用以下内容:

    <referenceBlock name="product.info.description">
        <arguments>
            <argument name="title" translate="true" xsi:type="string">Custom Name</argument>
        </arguments>
    </referenceBlock>
    

  • 2019-12-5
    3 #

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

  • magento 1.8:迷你推车向下推头,拉错了项目渲染侧边栏/ defaultphtml,而不是mini-cartpro / defaultphtml?
  • magento2:如何将搜索结果限制为1