Magento Commerce 2.3 remove register-link B2B in layout.xml
-
12-04-2021 - |
Question
In my B2C store I removed the register-link
in my theme.
I achieved this removing it in the Magento_Theme default.xml
with the following directive: <referenceBlock name="register-link" remove="true" />
In my B2B store I use the same directive in my default.xml
but it does not work. There it still shows the register link in the frontend.
Perhaps the register-link
is different here because you can create also a company account and not "just" a personal account.
Can anybody tell how to remove the register-link for B2B?
Solution
There are 2 ways in order to delete this link.
disable the allow_company_registration in the config by putting
company/general/allow_company_registration
to 0 (not recommended if you want this feature to be still active)Magento_Company/layout/default.xml with the following
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="register.company.link" remove="true" />
</body>
</page>
The second option will just delete the link for the register links dropdown but the feature will still be active on your website.