How to Add Header and Footer to Checkout Page in Magento 2
Header and footer play an important role in all the E-commerce websites on the internet. It helps the customers for navigation purposes and enhances the customer shopping experience also.
The default Magento 2 does not allow the admin to add a header and footer on the checkout page. Many Magento 2 store owners do not prefer to add a header and footer on the checkout page as the customers may get distracted and it may result in delayed conversions.
However, there are many store owners who choose to add a header and footer to the checkout page also.
For instance, if a merchant has added a customer care number in the header on the checkout page and if a customer has a query while purchasing a product, the customer can directly contact and solve his/her query. You may also want to remove the default footer links in Magento 2.
Let’s consider a scenario where your customer reached the checkout page after selecting some items to his cart but now he just wants to shop more or edit some items that he has in his cart. He can not move further without typing the exact URL in the browser again as there is no logo and links on the checkout page.
Let us understand the step-by-step method to add header and footer to checkout page in Magento 2.
Programmatic Solution to Add Header and Footer to Checkout Page in Magento 2
Create file checkout_index_index.xml file at app/code/Vendor/Extension/view/frontend/layout
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?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> <move element="logo" destination="header-wrapper" before="-"/> <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> </page> |
After adding this code, the header and footer are displayed in the frontend as shown here:
That’s it.
If you have queries regarding this blog, feel free to ask in the Comments section below.
I would be happy to answer your question.
Do consider sharing this post with Magento Community via social media.
Thank you.
Dipali Bhalala
Dipali is a Magento support executive at Meetanshi. Along with work, she is into painting, reading fiction novels, and Korean dramas!
4 Comments
Sorry, this is not a good solution for current versions of Magento (2.4)
Hello Ken,
Could you please explain in detail how you consider the above code as not a good solution?
Thanks
Dear ,
how we can add footer area on checkout page can you write blog on this method
Hello,
We have updated the post and added the code to add the footer to the checkout page also.
Thank You for drawing our attention.