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