1

I have added header and footer in checkout page by changing layout into 1column in onepage_index_index.xml.

I need footer only in checkout page.

I used IWD free extension for one step checkout.

4
  • you want to remove header from checkout page is that right? Oct 4, 2018 at 6:10
  • yes...i want to remove header from checkout page
    – manjula k
    Oct 4, 2018 at 6:27
  • Then Check my answer Oct 4, 2018 at 6:30
  • yes...header is removed but i need only logo in header part.logo also removed.can you please help to add logo in header.
    – manjula k
    Oct 4, 2018 at 6:36

2 Answers 2

1

If you want to remove header from checkout page then add below code in your onepage_index_index.xml file.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <body> 
   <referenceContainer name="footer-container">
      <block class="Magento\Theme\Block\Html\Footer" name="footer_block" template="html/footer.phtml"/>
   </referenceContainer>
   <referenceBlock name="header.container" remove="true" /> 
   <move element="logo" destination="page.wrapper" before="-"/>
 </body> 
</page>
5
  • 1
    It's working.header is removed from checkout page.Thank you
    – manjula k
    Oct 4, 2018 at 6:37
  • If you want to display only logo on top then I have edited my answer.Please check it Oct 4, 2018 at 6:49
  • 1
    Great....it's working...i got logo in header.Thank you so much.
    – manjula k
    Oct 4, 2018 at 6:54
  • hello...how to add footer in magento2 checkout page?
    – manjula k
    Nov 1, 2018 at 10:16
  • @manjulak I have edited my answer. Please check. Nov 13, 2018 at 4:18
1

Try this :

this file copy in your theme and add below content

vendor/magento/module-checkout/view/frontend/page_layout/checkout.xml

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
    <referenceContainer name="page.wrapper">
        <container name="checkout.header.container" as="checkout_header_container" label="Checkout Page Header Container" htmlTag="header" htmlClass="page-header" before="main.content">
            <container name="checkout.header.wrapper" label="Checkout Page Header" as="checkout_header_wrapper" htmlTag="div" htmlClass="header content"/>
        </container>
        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer"/>
    </referenceContainer>
    <move element="logo" destination="checkout.header.wrapper"/>
</layout>

Your Answer

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

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