src/Storefront/Resources/views/storefront/layout/header/actions/currency-widget.html.twig line 1

  1. {% block layout_header_actions_currency_widget %}
  2.     {% if position is empty %}
  3.         {% set position = 'top-bar' %}
  4.     {% endif %}
  5.     {% if page.header.currencies.count > 1 %}
  6.         <div class="top-bar-nav-item top-bar-currency">
  7.             {% block layout_header_actions_currency_widget_form %}
  8.                 <form method="post"
  9.                       action="{{ path('frontend.checkout.configure') }}"
  10.                       class="currency-form"
  11.                       data-form-auto-submit="true">
  12.                     {% block layout_header_actions_currency_widget_content %}
  13.                         <div class="currencies-menu dropdown">
  14.                             {% block layout_header_actions_currency_widget_dropdown_toggle %}
  15.                                 <button class="btn dropdown-toggle top-bar-nav-btn"
  16.                                         type="button"
  17.                                         id="currenciesDropdown-{{ position }}"
  18.                                         data-bs-toggle="dropdown"
  19.                                         aria-haspopup="true"
  20.                                         aria-expanded="false">
  21.                                     {% block layout_header_actions_currency_widget_dropdown_toggle_name %}
  22.                                         {{ page.header.activeCurrency.symbol }}
  23.                                         <span class="top-bar-nav-text">{{ page.header.activeCurrency.translated.name }}</span>
  24.                                     {% endblock %}
  25.                                 </button>
  26.                             {% endblock %}
  27.                             {% block layout_header_actions_currency_widget_form_items %}
  28.                                 <div class="top-bar-list dropdown-menu dropdown-menu-right"
  29.                                     aria-labelledby="currenciesDropdown-{{ position }}">
  30.                                     {% for currency in page.header.currencies %}
  31.                                         {% block layout_header_actions_currency_widget_form_items_element %}
  32.                                             <div class="top-bar-list-item dropdown-item{% if currency.id is same as(page.header.activeCurrency.id) %} item-checked{% endif %}"
  33.                                                  title="{{ currency.translated.shortName }}">
  34.                                                 {% block layout_header_actions_currency_widget_form_items_element_label %}
  35.                                                     <label class="top-bar-list-label"
  36.                                                            for="{{ position }}-{{ currency.id }}">
  37.                                                         {% block layout_header_actions_currency_widget_form_items_element_input %}
  38.                                                             <input class="top-bar-list-radio"
  39.                                                                    id="{{ position }}-{{ currency.id }}"
  40.                                                                    value="{{ currency.id }}"
  41.                                                                    name="currencyId"
  42.                                                                    type="radio"
  43.                                                                 {% if currency.id is same as(page.header.activeCurrency.id) %} checked{% endif %}>
  44.                                                             {{ currency.symbol }} {{ currency.translated.shortName }}
  45.                                                         {% endblock %}
  46.                                                     </label>
  47.                                                 {% endblock %}
  48.                                             </div>
  49.                                         {% endblock %}
  50.                                     {% endfor %}
  51.                                 </div>
  52.                             {% endblock %}
  53.                             {% block layout_header_actions_currency_widget_form_redirect %}
  54.                                 <input name="redirectTo"
  55.                                        type="hidden"
  56.                                        value="{{ app.request.get('_route') }}"/>
  57.                                 {% for key, value in app.request.attributes.get('_route_params') %}
  58.                                     <input name="redirectParameters[{{ key }}]"
  59.                                            type="hidden"
  60.                                            value="{{ value }}">
  61.                                 {% endfor %}
  62.                             {% endblock %}
  63.                         </div>
  64.                     {% endblock %}
  65.                 </form>
  66.             {% endblock %}
  67.         </div>
  68.     {% endif %}
  69. {% endblock %}