0

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

2
  • Why do you want to override the layout, and not just extend? If you're only moving a block you should extend the layout.
    – Silvan
    Commented Jul 13, 2017 at 15:05
  • Hi @Silvan , the core of magento try move element logo to another block but I need you not to move that block. Can i avoid if extend the layout?
    – str_lml
    Commented Jul 13, 2017 at 15:09

2 Answers 2

1

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.

0

you can do like this

<move element="logo" destination="checkout.header.wrapper"/>

you can change destination.

Make sure after do change, cache flush.

Hope it will work for you.

3
  • That's what checkout_index_index.xml does and I want to prevent it from doing that
    – str_lml
    Commented Jul 13, 2017 at 15:14
  • just put you destination="header.panel" Commented Jul 13, 2017 at 15:16
  • Ok, But for these i need to override .xml in /vendor/magento/module_checkout/view/frontend/layout and i don't want override the core.
    – str_lml
    Commented Jul 13, 2017 at 15:20

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.