customer.phtml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /** @var Magento\Customer\Block\Account\Customer $block */
  8. ?>
  9. <?php if($block->customerLoggedIn()): ?>
  10. <li class="customer-welcome">
  11. <span class="customer-name"
  12. role="link"
  13. tabindex="0"
  14. data-mage-init='{"dropdown":{}}'
  15. data-toggle="dropdown"
  16. data-trigger-keypress-button="true"
  17. data-bind="scope: 'customer'">
  18. <span data-bind="text: customer().fullname"></span>
  19. <button type="button"
  20. class="action switch"
  21. tabindex="-1"
  22. data-action="customer-menu-toggle">
  23. <span><?= $block->escapeHtml(__('Change')) ?></span>
  24. </button>
  25. </span>
  26. <script type="text/x-magento-init">
  27. {
  28. "*": {
  29. "Magento_Ui/js/core/app": {
  30. "components": {
  31. "customer": {
  32. "component": "Magento_Customer/js/view/customer"
  33. }
  34. }
  35. }
  36. }
  37. }
  38. </script>
  39. <?php if($block->getChildHtml()):?>
  40. <div class="customer-menu" data-target="dropdown">
  41. <?= $block->getChildHtml() ?>
  42. </div>
  43. <?php endif; ?>
  44. </li>
  45. <?php endif; ?>