0

Once logged in customer name will be shown with arrow beside it.

After clicking arrow a logout link appears.

My requirement is to remove that click action.

Directly can we show Logout link in header when customer is logged in?

Can anybody help me on this.

Thanks

1 Answer 1

1

You can Override

module-customer/view/frontend/templates/account/customer.phtml in theme folder.

<?php if($block->customerLoggedIn()): 

            echo $this->getLayout()
              ->createBlock('Magento\Customer\Block\Account\AuthorizationLink')
              ->setTemplate('Magento_Customer::account/link/authorization.phtml')
              ->toHtml();

endif; ?>

Paste only above code in phtml file.

4
  • yes, this will remove the welcome message but an arrow will be shown once cliked logout link appears.
    – Manjunath
    Commented Jul 10, 2019 at 14:58
  • @Manjunath Please check updated answer. Commented Jul 11, 2019 at 7:30
  • I hope you are not cleared with my question. what the above snippet will do can u please brief me?
    – Manjunath
    Commented Jul 11, 2019 at 7:34
  • @Manjunath please Override customer.phtml and remove code between condition. Hope it will work for you. Commented Jul 11, 2019 at 7:49

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.