cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to add account links to checkout header after upgrading to v. 2.4.6-p1 not working

Trying to add account links to checkout header after upgrading to v. 2.4.6-p1 not working

Hi,

we're updating Magento to the latest version from 2.4.2. 

We have a problem with the checkout page. With this update it has removed the search bar, cart link and account links from our child-theme.

 

We've checked our site using Luma, and see that the new version has only the logo and a text link "Sign-in"

 

We're trying to add our custom account button in the Magento_Checkout checkout_index_index-xml file which we put in the Magento_Theme default layout like this:

 

<referenceContainer name="header-wrapper">
 <block class="Magento\Framework\View\Element\Template" name="header.account" template="Magento_Theme::header-account.phtml" after="top.search"/>   
</referenceContainer> 

This works everywhere except on the checkout page.

 

We've tried creating a test block to position it in the header-wrapper container, but nothing ever appears. After playing around with the code it seems that perhaps on the checkout page "header-wrapper" no longer exists.

 

How to we position our account links in the checkout header? I can't find any reference to understand the structure of the checkout page and using template path hints isn't helping us.

3 REPLIES 3

Re: Trying to add account links to checkout header after upgrading to v. 2.4.6-p1 not working

Hello @SteveMacTV 

you can try.

 

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

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

in this checkout_index_index.xml file add the 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>
        <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>

 

------------------------------------------------
If you've found one of my answers helpful, please give "Kudos" or "Accept as Solution"

 

Re: Trying to add account links to checkout header after upgrading to v. 2.4.6-p1 not working

Thanks for this, I wasn't aware that you can create an override file within your own theme. is this new?

 

Anyway, this generates an error:

 

 

Overriding view file '/home/xx.xxx.com/xxxxx/public_html/app/design/frontend/Vendor/Theme/Magento_Checkout/layout/override/theme/Magento/blank/checkout_index_index.xml' does not match to any of the files.

 

 

Re: Trying to add account links to checkout header after upgrading to v. 2.4.6-p1 not working

You're facing layout changes on Magento's checkout page in v.2.4.6-p1:

  1. Checkout Layout: Magento's checkout uses a unique layout, different from other pages.
  2. Target the Right File: Modify the layout in checkout_index_index.xml of the Magento_Checkout module.
  3. Use Correct Container: "header-wrapper" might not exist on the checkout. Use a container like page.header.
  4. Flush Cache: Always clear Magento and browser caches after changes.
  5. Refer to Documentation: Check Magento's developer docs or Magento_Checkout layout XML files.
  6. Seek Assistance: If unresolved, consult a Magento developer or community forums.

Eden Wheeler
Splunk Course