custom/plugins/EmovaWbTheme/src/Resources/views/storefront/component/product/listing.html.twig line 1

Open in your IDE?
  1. {% set currentPage = ((searchResult.criteria.offset + 1) / searchResult.criteria.limit )|round(0, 'ceil') %}
  2. {% set paginationConfig = { page: currentPage }|json_encode %}
  3. {% set activeName = page.header.navigation.active.customFields.custom_emova_category_title %}
  4. {% if disableEmptyFilter is not defined %}
  5.     {% set disableEmptyFilter = config('core.listing.disableEmptyFilterOptions') %}
  6. {% endif %}
  7. {% set listingPagination = {
  8.     sidebar: sidebar,
  9.     params: params,
  10.     dataUrl: dataUrl,
  11.     filterUrl: filterUrl,
  12.     disableEmptyFilter: disableEmptyFilter,
  13.     snippets: {
  14.         resetAllButtonText: 'listing.filterPanelResetAll'|trans|sw_sanitize
  15.     }
  16. } %}
  17. {% block product_listing %}
  18.     <div class="cms-element-product-listing-wrapper"
  19.          data-listing-pagination="true"
  20.          data-listing-pagination-options='{{ paginationConfig }}'
  21.          data-listing="true"
  22.          data-listing-options='{{ listingPagination|json_encode }}'>
  23.         {% block element_product_listing_wrapper_content %}
  24.             <div class="cms-element-product-listing">
  25.                 {% if searchResult.total > 0 %}
  26.                     {% block element_product_listing_pagination_nav_actions %}
  27.                         <div style="padding-top: 30px; text-align: center;" class="cms-element-product-listing-actions row justify-content-between">
  28.                             {# <div class="col-md-auto">
  29.                                 {% block element_product_listing_pagination_nav_top %}
  30.                                     {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
  31.                                         entities: searchResult,
  32.                                         criteria: searchResult.criteria
  33.                                     } %}
  34.                                 {% endblock %}
  35.                             </div> #}
  36.                             <div class="col-md-auto almarenaDisplayBold" style="color: white; font-size:40px; width:100% !important; margin-bottom:30px">
  37.                                 {% if activeName %}
  38.                                 <h1>
  39.                                     {{ activeName }}
  40.                                 </h1>
  41.                                 {% endif %}
  42.                                 <div hidden>
  43.                                     Unsere Wallboxen
  44.                                 </div>
  45.                             </div>
  46.                             <div class="col-md-auto" style="width:100% !important">
  47.                                 {% block element_product_listing_sorting %}
  48.                                     {% sw_include '@Storefront/storefront/component/sorting.html.twig' with {
  49.                                         current: searchResult.sorting,
  50.                                         sortings: searchResult.availableSortings
  51.                                     } %}
  52.                                 {% endblock %}
  53.                             </div>
  54.                         </div>
  55.                     {% endblock %}
  56.                 {% endif %}
  57.                 {% block element_product_listing_row %}
  58.                     <div class="row cms-listing-row js-listing-wrapper centerHorizontally">
  59.                         {% if searchResult.total > 0 %}
  60.                             {% block element_product_listing_col %}
  61.                                 {% for product in searchResult %}
  62.                                     <div class="cms-listing-col {{ listingColumns }}"
  63.                                         style="padding-right: 12px !important; padding-left: 12px !important;
  64.                                                margin-bottom: 24px !important;">
  65.                                         {% block element_product_listing_box %}
  66.                                             {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  67.                                                 'layout': boxLayout,
  68.                                                 'displayMode': displayMode
  69.                                             } %}
  70.                                         {% endblock %}
  71.                                     </div>
  72.                                 {% endfor %}
  73.                             {% endblock %}
  74.                         {% else %}
  75.                             {% block element_product_listing_col_empty %}
  76.                                 <div class="cms-listing-col col-12">
  77.                                     {% block element_product_listing_col_empty_alert %}
  78.                                         {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  79.                                             type: 'info',
  80.                                             content: 'listing.emptyResultMessage'|trans|sw_sanitize
  81.                                         } %}
  82.                                     {% endblock %}
  83.                                 </div>
  84.                             {% endblock %}
  85.                         {% endif %}
  86.                     </div>
  87.                 {% endblock %}
  88.                 {% if searchResult.total > searchResult.limit %}
  89.                     {% block element_product_listing_pagination_nav_bottom %}
  90.                         {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
  91.                             entities: searchResult,
  92.                             criteria: searchResult.criteria,
  93.                             paginationLocation: 'bottom',
  94.                         } %}
  95.                     {% endblock %}
  96.                 {% endif %}
  97.             </div>
  98.         {% endblock %}
  99.     </div>
  100. {% endblock %}
  101. <style>
  102.   .centerHorizontally{
  103.         display: flex;
  104.         flex-direction: row;
  105.         flex-wrap: wrap;
  106.         justify-content: center;
  107.         align-items: center;
  108.     }
  109. </style>
  110. <script>
  111.     function openDetails(event, url){
  112.         if (!event.target.classList.contains('details-btn-arrow') && !event.target.closest('.details-btn-arrow')) {
  113.             window.location.href = url;
  114.         }
  115.     }
  116. </script>