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

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.

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

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.