0

I'm trying to re-add footer on checkout page after it's has been removed from Magento 2 Blank Theme:

magento/theme-frontend-blank/Magento_Checkout/layout/checkout_index_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="minicart" remove="true"/>
        <referenceContainer name="header.panel" remove="true"/>
        <referenceBlock name="top.search" remove="true"/>
        <referenceBlock name="catalog.compare.link" remove="true"/>
        <referenceBlock name="catalog.topnav" remove="true"/>
        <referenceContainer name="footer-container" remove="true"/>
    </body>
</page>

I'm tried to overide on my theme: Mystore/mytheme/Magento_Checkout/layout/checkout_index_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="footer-container" remove="false"/>
    </body>
</page>

But it didn't working, anyone can help?

6 Answers 6

7

Previous solution didn't work for me, so I found another.

In Magento 2 checkout page uses custom layout, placed in
vendor/magento/module-checkout/view/frontend/page_layout/checkout.xml

So, you need to replace it with any other layout (for example, to 1column).

Go to vendor/magento/module-checkout/view/frontend/layout and copy the file checkout_index_index.xml to your theme (without the declarations inside the <body>).

Then change this line:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

to

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

Then remove the header in the regular way.

4

I also faced the same issue and it was solved by overriding the default folder.

By default it is disabled in luma/blank theme. you just need to create basic structure on your theme folder and re-add the blocks you want

yourthemename\Magento_Checkout\layout\override\theme\Magento\blank

just copy checkout_index_index.xml here and in this file paste the below 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>
  <!-- <referenceBlock name="minicart" remove="true"/>-->
   <!--<referenceContainer name="header.panel" remove="true"/>-->
    <referenceBlock name="top.search" remove="true"/>
    <referenceBlock name="catalog.compare.link" remove="true"/>
    <referenceBlock name="catalog.topnav" remove="true"/>
   <!--<referenceContainer name="footer-container" remove="true"/>-->
</body>

2

You need override core layout for this. See documentation for this

Create file Mystore/mytheme/Magento_Checkout/layout/override/checkout_index_index.xml with content like

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="minicart" remove="true"/>
        <referenceContainer name="header.panel" remove="true"/>
        <referenceBlock name="top.search" remove="true"/>
        <referenceBlock name="catalog.compare.link" remove="true"/>
        <referenceBlock name="catalog.topnav" remove="true"/>
        <!-- <referenceContainer name="footer-container" remove="true"/> disable remove -->
    </body>
</page>
1

Go to Magento_Checkout/page_layout open checkout.xml

Add your Block container Header and footer.

-1

First go to Magento_Checkout in your theme folder app/design/frontend/package_name/theme_name/Magento_Checkout

Now create below folder structure in layout folder on above path. override/theme/Magento/blank/checkout_index_index.xml

in this checkout_index_index.xml file add below code.

<?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">
<body>
    <referenceBlock name="minicart" remove="false" />
    <referenceContainer name="header.panel" remove="false" />
    <referenceBlock name="top.search" remove="false" />
    <referenceBlock name="catalog.compare.link" remove="false" />
    <referenceBlock name="catalog.topnav" remove="false"/>
    <referenceContainer name="footer-container"  remove="false"/>
</body>

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.