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