After logging in, the user name is not displaying between 'Wilkommen' and 'Anmelden' .

  1. Which files are responsible for rendering out this part of the header ?

  2. How to get the user name of the currently logged in user ?

enter image description here

  • You can check if the data is correctly retrieve on the localStorage or by ajax call. Nov 28, 2016 at 13:05

2 Answers 2


Which files are responsible for rendreing out this part of the header ?


<span data-bind="text: customer().fullname ? $t('Welcome, %1!').replace('%1', customer().fullname) : '<?=$block->escapeHtml($welcomeMessage) ?>'"></span>

If you have third party theme, the file path can be app/design/frontend/Vendorname/theme762/Magento_Theme/templates/html/header.phtml

How to get the username of the currently logged in user ?

Refer the answer


For customer name you need to check vendor/magento/module-theme/view/frontend/templates/html/header.phtml

code : <span data-bind="text: new String('<?php echo $block->escapeHtml(__('Welcome, %1!', '%1'));?>').replace('%1', customer().firstname)"> </span>

Data is being fetched by knockout js using :

<script type="text/x-magento-init">
        "*": {
            "Magento_Ui/js/core/app": {
                "components": {
                    "customer": {
                        "component": "Magento_Customer/js/view/customer"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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