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

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/listing.html.twig' %}
  2. {% set currentPage = ((searchResult.criteria.offset + 1) / searchResult.criteria.limit )|round(0, 'ceil') %}
  3. {% set paginationConfig = { page: currentPage }|json_encode %}
  4. {% set productsPerPage = config('core.listing.productsPerPage') %}
  5. {% set visibleProducts = searchResult.limit > searchResult.total ? searchResult.total : searchResult.limit %}
  6. {% set loadMoreConfig = {
  7.   limit: searchResult.limit,
  8.   total: searchResult.total,
  9.   productsPerPage: productsPerPage
  10. } %}
  11. {% if disableEmptyFilter is not defined %}
  12.   {% set disableEmptyFilter = config('core.listing.disableEmptyFilterOptions') %}
  13. {% endif %}
  14. {% set listingPagination = {
  15.   sidebar: sidebar,
  16.   params: params,
  17.   dataUrl: dataUrl,
  18.   filterUrl: filterUrl,
  19.   disableEmptyFilter: disableEmptyFilter,
  20.   snippets: {
  21.     resetAllButtonText: 'listing.filterPanelResetAll'|trans|sw_sanitize
  22.   }
  23. } %}
  24. {% block product_listing %}
  25.   {% block element_product_listing_pagination_nav_actions %}
  26.     <div class="cms-element-product-listing-actions">
  27.       <div class="sorting-and-filter">
  28.         {% block element_product_listing_sorting %}
  29.           {% sw_include '@Storefront/storefront/component/sorting.html.twig' with {
  30.             current: searchResult.sorting,
  31.             sortings: searchResult.availableSortings
  32.           } %}
  33.         {% endblock %}
  34.       </div>
  35.       <div class="active-filters">
  36.         <h2 class="filter-panel-active-title">Ihre Filter</h2>
  37.         <div class="filter-panel-active-container"></div>
  38.       </div>
  39.     </div>
  40.   {% endblock %}
  41.   <div
  42.     class="cms-element-product-listing-wrapper"
  43.     data-listing-load-more="true"
  44.     data-listing-load-more-options='{{ loadMoreConfig|json_encode }}'
  45.     data-listing="true"
  46.     data-listing-options='{{ listingPagination|json_encode }}'
  47.   >
  48.     {% block element_product_listing_wrapper_content %}
  49.       <div class="cms-element-product-listing">
  50.         {% block element_product_listing_row %}
  51.           <div class="row cms-listing-row js-listing-wrapper">
  52.             {% if searchResult.total > 0 %}
  53.               {% block element_product_listing_col %}
  54.                 {% for product in searchResult %}
  55.                   {# In Shopware's default, classes {{ listingColumns }} are inserted here,
  56.                      which differ when a sidebar is shown (and may differ for product overview / wishlist /
  57.                      search results). For more flexibility we use a grid layout here. #}
  58.                   <div class="cms-listing-col">
  59.                     {% block element_product_listing_box %}
  60.                       {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  61.                         'layout': boxLayout,
  62.                         'displayMode': displayMode
  63.                       } %}
  64.                     {% endblock %}
  65.                   </div>
  66.                 {% endfor %}
  67.               {% endblock %}
  68.             {% else %}
  69.               {% block element_product_listing_col_empty %}
  70.                 <div class="cms-listing-col col-12">
  71.                   {% block element_product_listing_col_empty_alert %}
  72.                     {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  73.                       type: 'info',
  74.                       content: 'listing.emptyResultMessage'|trans|sw_sanitize
  75.                     } %}
  76.                   {% endblock %}
  77.                 </div>
  78.               {% endblock %}
  79.             {% endif %}
  80.           </div>
  81.         {% endblock %}
  82.         {% if searchResult.total > searchResult.limit %}
  83.           <div class="visible-products-progress">
  84.             <div class="progress">
  85.               <div
  86.                 class="progress-bar" role="progressbar"
  87.                 style="width: {{ 100 * (visibleProducts / searchResult.total) }}%"
  88.                 aria-valuenow="{{ visibleProducts }}"
  89.                 aria-valuemin="{{ productsPerPage }}"
  90.                 aria-valuemax="{{ searchResult.total }}"
  91.               >
  92.               </div>
  93.             </div>
  94.             <div class="progress-info">
  95.               {{ 'listing.visibleProductsInfo'|trans|replace({
  96.                 '%current%': visibleProducts,
  97.                 '%total%': searchResult.total,
  98.               }) }}
  99.             </div>
  100.             <wyn-button variant="secondary" class="progress-load-more-button js-load-more">
  101.               {{ 'listing.loadMoreProducts'|trans|sw_sanitize }}
  102.             </wyn-button>
  103.           </div>
  104.         {% endif %}
  105.       </div>
  106.     {% endblock %}
  107.   </div>
  108. {% endblock %}