2

I want to remove Register link from the header and rename Log in in Magento2.2.5?

Refer screenshot.

enter image description here

Any help would be appreciated.

  • how's doing, i shared the answer magento.stackexchange.com/a/273294/52244 which match your expected as i am assuming, if you feel and it matches your expectation please mark as valid answer, one more thing only asking question is not way of solving problems, once get the solutions, please shared. and mark as valid for shared answer by you or someone, hope you got my point. – Kanhaiya lal May 3 at 12:34
1

Remove Register Link from header globally

Go to (assuming you cloned your theme from LUMA theme so this file is exist in theme)

...\app\design\frontend\[COMPANY]\[THEME]\Magento_Customer\layout\default.xml

and add

<referenceBlock  name="register-link" remove="true"/>

code inside the body tag (best place to add at bottom before body close tag)


To Rename Log In in header globally

open ...\app\design\frontend\[COMPANY]\[THEME]\Magento_Customer\templates\account\link\authorization.phtml file

if not exist in theme then copy from

...\vendor\magento\module-customer\view\frontend\templates\account\link\authorization.phtml

or create empty file and paste below code

<?php

$dataPostParam = '';
$custom_label = __("Log In / Register"); // Added custom text
if ($block->isLoggedIn()) {
    $dataPostParam = sprintf(" data-post='%s'", $block->getPostParams());
    $custom_label = $block->getLabel(); 
}
?>
<li class="authorization-link" data-label="<?= $block->escapeHtmlAttr(__('or')) ?>">
    <a <?=  $block->getLinkAttributes() ?><?= $dataPostParam ?>>
        <?= $block->escapeHtml($custom_label) ?>
    </a>
</li>

Note : Above code copied from ...\vendor\magento\module-customer\view\frontend\templates\account\link\authorization.phtml and removed all comments area


Note : [COMPANY]\[THEME] value can replace with your company/theme

0

How to customize header all link like Sign in, compare product etc.. Try with below Blog link it will explain in detail.

If you want to add a custom link to the header then follow below blog link.

I hope it helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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