In Magento 2, the "header links" element (top.links) is missing on checkout pages. I'm using a custom theme with Magento/blank as the parent. I have added custom links to my theme at app/design/frontend/vendor/theme/Magento_Theme/layout/default.xml, and I want those links to also appear on checkout pages (everything after the cart page).
3 Answers
In your theme's xml file:
app/design/frontend/<Vendor>/<themename>/Magento_Checkout/layout/checkout_index_index.xml
Write 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>
<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"/>
<move element="logo" destination="header-wrapper"/>
</body>
</page>
-
Thanks, that adds the links back, but now the logo is missing?– BradCommented Aug 4, 2017 at 15:55
-
Add this line in the xml : <move element="logo" destination="header-wrapper"/> Commented Aug 8, 2017 at 5:21
-
For magento 2.2
For file checkout_index_index.xml
Change this
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout"
To this
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
Yes, just change attribute layout ;)
Just copy the content of your
app/design/frontend/vendor/theme/Magento_Theme/layout/default.xml
To
app/design/frontend/vendor/theme/Magento_Checkout/layout/checkout_index_index.xml
Flush cache and check.