Magento 2 – How to Override checkout_index_index.xml

checkoutmagento2overrides

I have a problem. I can't override file checkout_index_index.xml in my page.

I need override because this file move logo to another position in the page.

I copied the file in the next directories: –

app/design/frontend/theme/namespace/Magento_Checkout/layout/override/base
app/design/frontend/theme/namespace/Magento_Checkout/layout/override/theme/blank
app/design/frontend/theme/namespace/Magento_Checkout/layout/override/Magento/blank

Any one Please help

Solved

For override I put checkout_index_index.xml in /app/design/frontend/theme/namespace/Magento_Checkout/layout/ and put inside of file this code:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <move element="logo" destination="div.header" before="-"/>
</body>

Thank you All

Best Answer

Extend the checkout_index_index.xml by going to app/design/frontend/YourVendor/YourTheme/Magento_Checkout/layout and do a checkout_index_index.xml file.

In that xml file add this code which will revert the moving functionality:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="logo" destination="header.panel"/>
    </body>
</page>

I hope this helps.