1

I want to override following file in my custom module:

module-sales/view/adminhtml/templates/order/create/shipping/method

What I did so far:

magento/app/code/view/adminhtml/layout/sales_order_create_index.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="shipping_method">
            <referenceBlock name="form">
                <action method="setTemplate">
                    <argument name="shopmethtempindex" xsi:type="string">UV_Adressen::order/create/shipping/method/form.phtml</argument>
                </action>
            </referenceBlock>
        </referenceBlock>

    </body>
</page>

Placed the template here:

/var/www//magento/app/code//view/adminhtml/templates/order/create/shipping/method/form.phtml

Why doesn't it work?

3

You did the mistake

<referenceBlock name="form">

should be

<referenceBlock name="order_create_shipping_form">

also <referenceBlock name="shipping_method"> not need

that layout code should be like:

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="order_create_shipping_form">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">UV_Adressen::order/create/shipping/method/form.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

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.