- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2019
07:10 AM
02-05-2019
07:10 AM
Hello,
On the top header there is the welcome part with the name and then again the name, any idea how to fix this (only to get the welcome part)?
Solved! Go to Solution.
Labels:
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2019
08:03 AM
02-05-2019
08:03 AM
Open vendor/magento/module-theme/view/frontend/templates/html/header.phtml .This template is responsible for displaying welcome message. So overwrite this phtml and replace by following content.
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // @codingStandardsIgnoreFile /** * @var \Magento\Theme\Block\Html\Header $block */ $welcomeMessage = $block->getWelcome(); ?> <?php switch ($block->getShowPart()): case 'welcome': ?> <li class="greet welcome" data-bind="scope: 'customer'"> <!-- ko if: customer().fullname --> <span data-bind="html: '<?= $block->escapeHtml(__('Welcome')) ?>'"></span> <!-- /ko --> <!-- ko ifnot: customer().fullname --> <span data-bind='html:"<?= $block->escapeHtml($welcomeMessage) ?>"'></span> <?= $block->getBlockHtml('header.additional') ?> <!-- /ko --> </li> <script type="text/x-magento-init"> { "*": { "Magento_Ui/js/core/app": { "components": { "customer": { "component": "Magento_Customer/js/view/customer" } } } } } </script> <?php break; ?> <?php case 'other': ?> <?= $block->getChildHtml() ?> <?php break; ?> <?php endswitch; ?>
Now Clear cache.
-----
If Issue Solved, Click Kudos and Accept As solutions.
Sohel Rana, 7x Magento 2, 2x Magento 1 Certified
If Issue Solved, Click Kudos and Accept As solutions.
Sohel Rana, 7x Magento 2, 2x Magento 1 Certified
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2019
08:03 AM
02-05-2019
08:03 AM
Open vendor/magento/module-theme/view/frontend/templates/html/header.phtml .This template is responsible for displaying welcome message. So overwrite this phtml and replace by following content.
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // @codingStandardsIgnoreFile /** * @var \Magento\Theme\Block\Html\Header $block */ $welcomeMessage = $block->getWelcome(); ?> <?php switch ($block->getShowPart()): case 'welcome': ?> <li class="greet welcome" data-bind="scope: 'customer'"> <!-- ko if: customer().fullname --> <span data-bind="html: '<?= $block->escapeHtml(__('Welcome')) ?>'"></span> <!-- /ko --> <!-- ko ifnot: customer().fullname --> <span data-bind='html:"<?= $block->escapeHtml($welcomeMessage) ?>"'></span> <?= $block->getBlockHtml('header.additional') ?> <!-- /ko --> </li> <script type="text/x-magento-init"> { "*": { "Magento_Ui/js/core/app": { "components": { "customer": { "component": "Magento_Customer/js/view/customer" } } } } } </script> <?php break; ?> <?php case 'other': ?> <?= $block->getChildHtml() ?> <?php break; ?> <?php endswitch; ?>
Now Clear cache.
-----
If Issue Solved, Click Kudos and Accept As solutions.
Sohel Rana, 7x Magento 2, 2x Magento 1 Certified
If Issue Solved, Click Kudos and Accept As solutions.
Sohel Rana, 7x Magento 2, 2x Magento 1 Certified
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2019
08:45 AM
02-05-2019
08:45 AM
Re: Top header, change welcome message
Thanks!