3

I have been playing around with removing elements on magento 2's one page checkout. Not sure how to remove the sole sign in link provided during checkout in the header. The code below does not work in cart_index_index.xml. Any help is appreciated.

  <referenceBlock name="authentication-wrapper" remove="true"/>
2
  • are u talk about which page checkout or cart?
    – Amit Bera
    Aug 4, 2016 at 17:55
  • The checkout page, where the shipping is entered. By default magento removes all links and provides a sign in link if the user is not currently signed in. I'm looking for a way to remove the sign in link as well. Aug 4, 2016 at 17:59

1 Answer 1

13

Add the layout file magento_checkout/view/frontend/layout/checkout_index_index.xml to your module or theme with this contents:

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="authentication" xsi:type="array">
                                    <item name="config" xsi:type="array">
                                        <item name="componentDisabled" xsi:type="boolean">true</item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

This disables the JS component that renders the authentication element.

2
  • 2
    For people who don't understand how to do this, you have to place above file under app/design/frontend/<vendor>/<theme_name>/Magento_Checkout/layout/checkout_index_index.xml Aug 2, 2018 at 9:08
  • Thanks worked great from my end!!! Jul 24, 2019 at 7:47

Your Answer

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

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