8

我尝试覆盖

供应商\magento\module-multishipping\view\frontend\templates\checkout\addresses.phtml

我创建布局

app\code\My\CustomModule\view\frontend\layout\multishipping_checkout_addresses.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>
        <referenceContainer name="content">
            <block class="Magento\Multishipping\Block\Checkout\Addresses" name="checkout_addresses" template="My_CustomModule::checkout/addresses.phtml" cacheable="false">
            </block>
        </referenceContainer>
    </body>
</page>

和模板

app\code\My\CustomModule\view\frontend\templates\checkout\addresses.phtml

<h1>It works </h1>

它不起作用...请帮助我!谢谢。

4

2 回答 2

7
<referenceBlock name='copyright'>
    <action method='setTemplate'>
        <argument name='template' xsi:type='string'>Dfr_Backend::page/copyright.phtml</argument>
    </action>
</referenceBlock>
于 2016-02-08T16:45:31.347 回答
2

<action>指令已弃用。您还可以使用:

<referenceBlock name="form.subscribe" template="{Vendor_Module}::newsletter/subscribe.phtml" />
于 2020-07-05T13:55:00.363 回答