0

I need to create a custom template for shipping method item

view/frontend/web/template/shipping-address/shipping-method-item.html

However, this template file has allready been overwritten by another module, so this method is not working.

<item name="shipping-step" xsi:type="array">
    <item name="children" xsi:type="array">
        <item name="shippingAddress" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="shippingMethodItemTemplate" xsi:type="string">DM_Checkout/shipping-method-item</item>
            </item>
        </item>
    </item>
</item>

The other module looks like this:

vendor/quickpay/magento2/view/frontend/layout/checkout_index_index.xml

<item name="shipping-step" xsi:type="array">
    <item name="children" xsi:type="array">
        <item name="shippingAddress" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="shippingMethodItemTemplate" xsi:type="string">QuickPay_Gateway/shipping/shipping-method-item</item>
            </item>
        </item>
    </item>
</item>

What would be the best approach to accomplish this task?

1 Answer 1

0

I think the easiest way is to add the template to your theme under the other module's name, like:

app/design/frontend/YourVendor/YourTheme/QuickPay_Gateway/...

What you are doing like this is actually overriding the other module's template without having to edit a file in the vendor/ directory

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.