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.

  • you want to remove header from checkout page is that right? – Chintan Kaneriya Oct 4 '18 at 6:10
  • yes...i want to remove header from checkout page – manjula k Oct 4 '18 at 6:27
  • Then Check my answer – Chintan Kaneriya Oct 4 '18 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 '18 at 6:36
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>
| improve this answer | |
  • 1
    It's working.header is removed from checkout page.Thank you – manjula k Oct 4 '18 at 6:37
  • If you want to display only logo on top then I have edited my answer.Please check it – Chintan Kaneriya Oct 4 '18 at 6:49
  • 1
    Great....it's working...i got logo in header.Thank you so much. – manjula k Oct 4 '18 at 6:54
  • hello...how to add footer in magento2 checkout page? – manjula k Nov 1 '18 at 10:16
  • @manjulak I have edited my answer. Please check. – Chintan Kaneriya Nov 13 '18 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>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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