src/Elements/Bundle/DemiFrontendBundle/Resources/views/Includes/cards/form-groups/country.html.twig line 1

Open in your IDE?
  1. {% set customerCountry = customer is not empty ? customer.getCountry() : null %}
  2. {% set guessedCountryIso = customerCountry is not null  ? customerCountry.getCountrycode() : demi_getGuessedCountry() %}
  3. <div class="form-group">
  4.     <label class="form-box form-box--gray">
  5.         <span class="form-box__label">{{ 'demi.booking.checkout.country'|trans }} *</span>
  6.         <select name="country" class="form-box__content form-control {{ class is defined ? class : '' }}" required
  7.                 autocomplete="country">
  8.             {% for country in  demi_getSortedCountries([], isMerchandise ? true : false) %}
  9.                 {% set isSelected = guessedCountryIso == country["countrycode"] %}
  10.                 <option value="{{ country["countrycode"] }}" {{ isSelected ? ' selected="selected"' : '' }}>{{ country["name"] }}</option>
  11.             {% endfor %}
  12.         </select>
  13.         <span class="demi-icon demi-icon-chevron-down form-box__select-icon" aria-hidden="true"></span>
  14.     </label>
  15.     <div class="form-errors"></div>
  16. </div>