custom/plugins/NetiNextStoreLocator/src/Resources/views/storefront/store_locator/search.twig line 1

Open in your IDE?
  1. {% block neti_store_locator_search %}
  2.     <form class="neti-next-store-locator-filter search-container row border-bottom mb-2">
  3.         <div class="container mx-3 d-flex">
  4.             {% block neti_store_locator_search_locate_button %}
  5.                 <template v-if="geoLocationEnabled">
  6.                     <button
  7.                         v-if="isLocating"
  8.                         class="locate btn btn-light mr-2"
  9.                     >
  10.                         <div class="spinner-border spinner"></div>
  11.                     </button>
  12.                     <button
  13.                             v-else
  14.                             class="locate btn btn-light mr-2"
  15.                             @click.prevent="onLocate"
  16.                             aria-label="locate"
  17.                     >
  18.                         {% sw_icon 'gps' %}
  19.                     </button>
  20.                 </template>
  21.             {% endblock %}
  22.             {% block neti_store_locator_search_input %}
  23.                 <div
  24.                         class="search-input"
  25.                         :class="{ 'has-countries': countries.length > 2, 'has-country-filter': config.showCountryFilter }"
  26.                 >
  27.                     {% block neti_store_locator_search_input_country_select %}
  28.                         <div class="dropdown country-select" v-if="countries.length > 2">
  29.                             <button
  30.                                     class="btn dropdown-toggle" type="button" id="dropdownCountries"
  31.                                     data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
  32.                             >
  33.                                 <span class="badge badge-primary selected-country" v-if="selectedCountry">
  34.                                     {{ '{{ selectedCountry.isoCode }}' }}
  35.                                 </span>
  36.                             </button>
  37.                             <div class="dropdown-menu" aria-labelledby="dropdownCountries">
  38.                                 <input
  39.                                         v-if="config.showCountryFilter"
  40.                                         class="country-filter"
  41.                                         type="text"
  42.                                         placeholder="{{ "neti-next-store-locator.index.search.placeholderCountryFilter"|trans }}"
  43.                                         v-model="countryFilterInput"
  44.                                 />
  45.                                 <div class="dropdown-item-container">
  46.                                     <a
  47.                                             href="#" class="dropdown-item"
  48.                                             v-for="(country, key) in filteredCountries" :key="key"
  49.                                             @click.prevent="onSelectCountry(country)"
  50.                                     >
  51.                                         <div class="country-iso-code">
  52.                                         <span class="badge badge-light ">
  53.                                             {{ '{{ country.isoCode }}' }}
  54.                                         </span>
  55.                                         </div>
  56.                                         <div class="country-label">
  57.                                             {{ '{{ country.label }}' }}
  58.                                         </div>
  59.                                     </a>
  60.                                 </div>
  61.                                 <div class="no-results" v-if="filteredCountries.length === 0">
  62.                                     {{ "neti-next-store-locator.index.search.noCountriesText"|trans }}
  63.                                 </div>
  64.                             </div>
  65.                         </div>
  66.                     {% endblock %}
  67.                     {% block neti_store_locator_search_input_field %}
  68.                         <input
  69.                                 type="text" name="address"
  70.                                 placeholder="{{ "neti-next-store-locator.index.search.placeholder"|trans }}"
  71.                                 class="form-control flex-fill"
  72.                                 v-model="searchInput"
  73.                                 ref="searchInput"
  74.                                 @focus="searchInputFocused = true"
  75.                                 @blur="onBlur"
  76.                                 @keydown.enter.prevent="onAutocompletedSearch"
  77.                                 autocomplete="off"
  78.                                 aria-label="Search stores"
  79.                         />
  80.                     {% endblock %}
  81.                 </div>
  82.             {% endblock %}
  83.             {% block neti_store_locator_search_toggle_filter_button %}
  84.                 <button class="toggle-filter btn btn-light ml-2" @click.prevent="onToggleFilter" aria-label="Toggle filter">
  85.                     {% sw_icon 'filter' %}
  86.                     <span class="filter-badge" v-if="searchFilter.customFilterCount > 0"></span>
  87.                 </button>
  88.             {% endblock %}
  89.             {% block neti_store_locator_search_toggle_stores_button %}
  90.                 <button class="toggle-stores btn btn-light ml-2" v-if="isMobile" @click.prevent="onToggleStores">
  91.                     {% sw_icon 'editor-list' %}
  92.                 </button>
  93.             {% endblock %}
  94.             {% block neti_store_locator_search_autocomplete_search_result %}
  95.                 <div
  96.                         class="autocomplete-search-result"
  97.                         v-if="searchInputFocused && searchInput.length"
  98.                 >
  99.                     {% if config('NetiNextStoreLocator.config.autocompleteResultPriority') == 'stores_before_places' %}
  100.                         {% sw_include '@Storefront/storefront/store_locator/search/autocomplete-stores.html.twig' %}
  101.                         {% sw_include '@Storefront/storefront/store_locator/search/autocomplete-places.html.twig' %}
  102.                     {% else %}
  103.                         {% sw_include '@Storefront/storefront/store_locator/search/autocomplete-places.html.twig' %}
  104.                         {% sw_include '@Storefront/storefront/store_locator/search/autocomplete-stores.html.twig' %}
  105.                     {% endif %}
  106.                     <div class="search-result" v-if="!autocompleteResults.length && !autocompletedStores.length">
  107.                         {{ "neti-next-store-locator.index.search.autocompleteNoResults"|trans }}
  108.                     </div>
  109.                 </div>
  110.             {% endblock %}
  111.         </div>
  112.         {% block neti_store_locator_search_filter %}
  113.             <div
  114.                     :class="filterClass"
  115.                     v-offcanvas="filter.offCanvas ? { open: filter.opened } : null"
  116.                     @close="filter.opened = false"
  117.                     @opened="onOffcanvasOpened"
  118.                     @closed="onOffcanvasClosed"
  119.             >
  120.                 <div class="col">
  121.                     {% block neti_store_locator_search_filter_header %}
  122.                         <div class="header">
  123.                             {{ "neti-next-store-locator.index.search.filterHeader"|trans }}
  124.                             <div class="close-button" @click="filter.opened = false">
  125.                                 {% sw_icon 'x' %}
  126.                             </div>
  127.                         </div>
  128.                     {% endblock %}
  129.                     {% block neti_store_locator_search_filter_radius %}
  130.                         <div class="form-group">
  131.                             <label for="radius">
  132.                                 {{ "neti-next-store-locator.index.search.fieldRadius"|trans }}
  133.                             </label>
  134.                             <select id="radius" name="radius" class="custom-select" v-model="searchFilter.radius">
  135.                                 <option>
  136.                                     {{ "neti-next-store-locator.index.search.fieldRadiusPlaceholder"|trans }}
  137.                                 </option>
  138.                                 {% for item in page.radiusList %}
  139.                                     <option value="{{ item.value }}">
  140.                                         {{ item.value }}
  141.                                         {{ page.config.distanceUnit }}
  142.                                     </option>
  143.                                 {% endfor %}
  144.                             </select>
  145.                         </div>
  146.                     {% endblock %}
  147.                     {% block neti_store_locator_search_filter_order %}
  148.                         <div class="form-group">
  149.                             <label for="order">
  150.                                 {{ "neti-next-store-locator.index.search.fieldOrder"|trans }}
  151.                             </label>
  152.                             <div class="d-flex flex-row space">
  153.                                 <select id="order" name="order" class="custom-select" v-model="searchFilter.orderBy.id">
  154.                                     {% for key, orderType in page.orderTypes %}
  155.                                         <option value="{{ orderType }}"{% if key == 0 %} selected{% endif %}>
  156.                                             {{ ("neti-next-store-locator.index.search.order." ~ orderType)|trans }}
  157.                                         </option>
  158.                                     {% endfor %}
  159.                                 </select>
  160.                                 &nbsp;
  161.                                 <div class="btn-group" role="group">
  162.                                     <button
  163.                                             type="button" class="btn"
  164.                                             :class="searchFilter.orderBy.direction === 'asc' ? 'btn-secondary' : 'btn-outline-secondary'"
  165.                                             @click="searchFilter.orderBy.direction = 'asc'"
  166.                                     >
  167.                                         &uarr;
  168.                                     </button>
  169.                                     <button
  170.                                             type="button" class="btn"
  171.                                             :class="searchFilter.orderBy.direction === 'desc' ? 'btn-secondary' : 'btn-outline-secondary'"
  172.                                             @click="searchFilter.orderBy.direction = 'desc'"
  173.                                     >
  174.                                         &darr;
  175.                                     </button>
  176.                                 </div>
  177.                             </div>
  178.                         </div>
  179.                     {% endblock %}
  180.                     {% block neti_store_locator_search_filter_featured %}
  181.                         {% if config('NetiNextStoreLocator.config.enableFilterOnlyFeatured') == true %}
  182.                             <div class="form-check form-group">
  183.                                 <input
  184.                                         class="form-check-input"
  185.                                         type="checkbox"
  186.                                         id="onlyFeatured"
  187.                                         v-model="searchFilter.onlyFeatured"
  188.                                 >
  189.                                 <label class="form-check-label" for="onlyFeatured">
  190.                                     {{ "neti-next-store-locator.index.search.onlyFeatured"|trans }}
  191.                                 </label>
  192.                             </div>
  193.                         {% endif %}
  194.                     {% endblock %}
  195.                     <div class="custom-filter-container" v-if="searchFilter.customFilterVisible">
  196.                         {% block neti_store_locator_search_filter_custom %}
  197.                             {% sw_include '@Storefront/storefront/store_locator/filter/index.html.twig' %}
  198.                         {% endblock %}
  199.                     </div>
  200.                     {% block neti_store_locator_search_filter_buttons %}
  201.                         <div class="buttons d-flex flex-row justify-content-between">
  202.                             <button type="reset" class="btn btn-secondary btn-sm" @click.prevent="onReset">
  203.                                 {{ "neti-next-store-locator.index.search.buttonReset"|trans }}
  204.                             </button>
  205.                             <button type="submit" class="btn btn-primary btn-sm" @click.prevent="onSearch">
  206.                                 {{ "neti-next-store-locator.index.search.buttonSearch"|trans }}
  207.                             </button>
  208.                         </div>
  209.                     {% endblock %}
  210.                 </div>
  211.             </div>
  212.         {% endblock %}
  213.     </form>
  214. {% endblock %}