I'm trying to extend checkout page, I copied the


in my layout folder (vendor/theme/Magento_Checkout/layout) I change some thing in the file, now in the payment method I can't find method I set on the admin page. If I remove my custom layout file, the method come's back and they work's fine.

This'is my custom xml file (I remove jsLayout part I didn't modify it):

<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <css src="css/checkout.css" media="screen,projection" />
    <referenceContainer name="page.messages" remove="true"/>
    <move element="logo" destination="top-header" before="header-links"/>
    <referenceContainer name="newsletternewsletter" remove="true"/>
    <referenceBlock name="page.main.title">
        <action method="setPageTitle">
            <argument translate="true" name="title" xsi:type="string">Checkout</argument>
    <referenceContainer name="content">
        <container name="checkout-container" as="checkout-container" htmlTag="div" htmlClass="row no-margin">
            <container name="checkout-center" as="checkout-center" htmlTag="div" htmlClass="col s12 m10 l10 offset-m1 offset-l1">
                <container name="checkout-border" as="checkout-border" htmlTag="div" htmlClass="dashboard-container">

                    <block class="Magento\Checkout\Block\Onepage" name="checkout.root" template="Magento_Checkout::onepage.phtml" cacheable="false">
                            <argument name="jsLayout" xsi:type="array">
                                <!-- NO CHANGE HERE -->


1 Answer 1


I saw many developers who did the same way. We shouldn't try to override the layouts by copying them to our module or theme. And then, we modify them.

In your case, we overridden "completely" the original layout. So, any changes will affect to the global layout node.

Rather than copy extensive page layout or page configuration code and then modify what you want to change, in the Magento system, you only need to create an extending layout file that contains the changes you want.

Magento 2 Layout


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.