vendor/shopware/storefront/Resources/views/storefront/component/product/listing.html.twig line 61

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. {% if disableEmptyFilter is not defined %}
  4.     {% set disableEmptyFilter = config('core.listing.disableEmptyFilterOptions') %}
  5. {% endif %}
  6. {% set listingPagination = {
  7.     sidebar: sidebar,
  8.     params: params,
  9.     dataUrl: dataUrl,
  10.     filterUrl: filterUrl,
  11.     disableEmptyFilter: disableEmptyFilter,
  12.     snippets: {
  13.         resetAllButtonText: 'listing.filterPanelResetAll'|trans|sw_sanitize
  14.     }
  15. } %}
  16. {% block product_listing %}
  17.     <div class="cms-element-product-listing-wrapper"
  18.          data-listing-pagination="true"
  19.          data-listing-pagination-options='{{ paginationConfig }}'
  20.          data-listing="true"
  21.          data-listing-options='{{ listingPagination|json_encode }}'>
  22.         {% block element_product_listing_wrapper_content %}
  23.             <div class="cms-element-product-listing">
  24.                 {% if searchResult.total > 0 %}
  25.                     {% block element_product_listing_pagination_nav_actions %}
  26.                         <div class="cms-element-product-listing-actions row justify-content-between">
  27.                             <div class="col-md-auto">
  28.                                 {% block element_product_listing_pagination_nav_top %}
  29.                                     {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
  30.                                         entities: searchResult,
  31.                                         criteria: searchResult.criteria
  32.                                     } %}
  33.                                 {% endblock %}
  34.                             </div>
  35.                             <div class="col-md-auto">
  36.                                 {% block element_product_listing_sorting %}
  37.                                     {% sw_include '@Storefront/storefront/component/sorting.html.twig' with {
  38.                                         current: searchResult.sorting,
  39.                                         sortings: searchResult.availableSortings
  40.                                     } %}
  41.                                 {% endblock %}
  42.                             </div>
  43.                         </div>
  44.                     {% endblock %}
  45.                 {% endif %}
  46.                 {% block element_product_listing_row %}
  47.                     <div class="row cms-listing-row js-listing-wrapper">
  48.                         {% if searchResult.total > 0 %}
  49.                             {% block element_product_listing_col %}
  50.                                 {% for product in searchResult %}
  51.                                     <div class="cms-listing-col {{ listingColumns }}">
  52.                                         {% block element_product_listing_box %}
  53.                                             {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  54.                                                 'layout': boxLayout,
  55.                                                 'displayMode': displayMode
  56.                                             } %}
  57.                                         {% endblock %}
  58.                                     </div>
  59.                                 {% endfor %}
  60.                             {% endblock %}
  61.                         {% else %}
  62.                             {% block element_product_listing_col_empty %}
  63.                                 <div class="cms-listing-col col-12">
  64.                                     {% block element_product_listing_col_empty_alert %}
  65.                                         {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  66.                                             type: 'info',
  67.                                             content: 'listing.emptyResultMessage'|trans|sw_sanitize
  68.                                         } %}
  69.                                     {% endblock %}
  70.                                 </div>
  71.                             {% endblock %}
  72.                         {% endif %}
  73.                     </div>
  74.                 {% endblock %}
  75.                 {% if searchResult.total > searchResult.limit %}
  76.                     {% block element_product_listing_pagination_nav_bottom %}
  77.                         {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
  78.                             entities: searchResult,
  79.                             criteria: searchResult.criteria
  80.                         } %}
  81.                     {% endblock %}
  82.                 {% endif %}
  83.             </div>
  84.         {% endblock %}
  85.     </div>
  86. {% endblock %}