Advertisement
Guest User

Untitled

a guest
Aug 15th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.86 KB | None | 0 0
  1. diff --git a/Magento_Directory/templates/currency.phtml b/Magento_Directory/templates/currency.phtml
  2. new file mode 100644
  3. index 0000000..431cb0e
  4. --- /dev/null
  5. +++ b/Magento_Directory/templates/currency.phtml
  6. @@ -0,0 +1,29 @@
  7. +<?php /* @var \Magento\Directory\Block\Currency $block */ ?>
  8. +<?php if ($block->getCurrencyCount() > 1): ?>
  9. +<?php $currencies = $block->getCurrencies(); ?>
  10. +<?php $currentCurrencyCode = $block->getCurrentCurrencyCode(); ?>
  11. +<?php $id = $block->getIdModifier() ? '-' . $block->getIdModifier() : '' ?>
  12. +<div class="switcher currency switcher-currency" id="switcher-currency<?= $block->escapeHtmlAttr($id) ?>">
  13. +    <strong class="label switcher-label"><span><?= $block->escapeHtml(__('Currency')) ?></span></strong>
  14. +    <div class="actions dropdown options switcher-options">
  15. +        <div class="action toggle switcher-trigger"
  16. +             id="switcher-currency-trigger<?= $block->escapeHtmlAttr($id) ?>"
  17. +             data-mage-init='{"dropdown":{}}'
  18. +             data-toggle="dropdown"
  19. +             data-trigger-keypress-button="true">
  20. +            <strong class="language-<?= $block->escapeHtml($block->getCurrentCurrencyCode()) ?>">
  21. +                <span><?= $block->escapeHtml($currentCurrencyCode) ?></span>
  22. +            </strong>
  23. +        </div>
  24. +        <ul class="dropdown switcher-dropdown" data-target="dropdown">
  25. +            <?php foreach ($currencies as $_code => $_name): ?>
  26. +                <?php if ($_code != $currentCurrencyCode): ?>
  27. +                    <li class="currency-<?= $block->escapeHtmlAttr($_code) ?> switcher-option">
  28. +                        <a href="#" data-post='<?= /* @noEscape */ $block->getSwitchCurrencyPostData($_code) ?>'><?= $block->escapeHtml($_code) ?> - <?= $block->escapeHtml($_name) ?></a>
  29. +                    </li>
  30. +                <?php endif; ?>
  31. +            <?php endforeach; ?>
  32. +        </ul>
  33. +    </div>
  34. +</div>
  35. +<?php endif; ?>
  36. diff --git a/Magento_Theme/layout/default.xml b/Magento_Theme/layout/default.xml
  37. index b035d55..f5e032c 100644
  38. --- a/Magento_Theme/layout/default.xml
  39. +++ b/Magento_Theme/layout/default.xml
  40. @@ -27,6 +27,7 @@
  41.          </referenceContainer>
  42.  
  43.          <move element="minicart" destination="header-content-right" />
  44. +        <move element="currency" destination="header-content-right" before="-" />
  45.          <move element="store_language" destination="header-wrapper" before="logo" />
  46.          <move element="store_switcher" destination="footer-toolbar-bottom" before="-" />
  47.          <move element="navigation.sections" destination="header.container"/>
  48. diff --git a/web/css/source/argento_theme/layout/_header.less b/web/css/source/argento_theme/layout/_header.less
  49. index f3f4892..b27e1b0 100644
  50. --- a/web/css/source/argento_theme/layout/_header.less
  51. +++ b/web/css/source/argento_theme/layout/_header.less
  52. @@ -38,7 +38,8 @@
  53.  
  54.              .wishlist,
  55.              .customer-dropdown,
  56. -            .customer.switcher {
  57. +            .customer.switcher,
  58. +            .currency.switcher  {
  59.                  display: none;
  60.              }
  61.          }
  62. @@ -195,6 +196,10 @@
  63.          .header-content-right {
  64.              .right(25px);
  65.  
  66. +            .currency.switcher {
  67. +                display: block;
  68. +            }
  69. +
  70.              .customer.switcher {
  71.                  display: block;
  72.                  .margin-left(0);
  73. diff --git a/web/css/source/argento_theme/pages/_home.less b/web/css/source/argento_theme/pages/_home.less
  74. index 34a176f..839786c 100644
  75. --- a/web/css/source/argento_theme/pages/_home.less
  76. +++ b/web/css/source/argento_theme/pages/_home.less
  77. @@ -258,8 +258,11 @@
  78.                  background: transparent;
  79.              }
  80.  
  81. -            .switcher-language .switcher-trigger {
  82. -                color: #fff;
  83. +            .switcher-language,
  84. +            .switcher-currency {
  85. +                .switcher-trigger {
  86. +                    color: #fff;
  87. +                }
  88.              }
  89.  
  90.              .block-search.folded .action.search {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement