Magento 2 One Page Checkout – Remove Header Sign In Link

magento-2.1magento2

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"/>

Best Answer

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.

Related Topic