custom/plugins/KmPitchPrint/src/Resources/views/storefront/component/product/km-listing.html.twig line 97

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.                                     {% set km_add_pp_products = km_add_pp_products(product, context, app.request.cookies.get('pp_id'), boxLayout, displayMode, listingColumns) %}
  52.                                     {% if km_add_pp_products %}
  53.                                        {{ km_add_pp_products | raw }}
  54.                                     {% else %}
  55.                                         {% sw_include '@KmPitchPrint/storefront/component/product/km-element-product-listing-box.html.twig' %}
  56.                                     {% endif%}
  57.                                     {# { % sw_include '@KmPitchPrint/storefront/component/product/km-element-product-listing-box.html.twig' % } #}
  58.                                 {% endfor %}
  59.                             {% endblock %}
  60.                         {% else %}
  61.                             {% block element_product_listing_col_empty %}
  62.                                 <div class="cms-listing-col col-12">
  63.                                     {% block element_product_listing_col_empty_alert %}
  64.                                         {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  65.                                             type: 'info',
  66.                                             content: 'listing.emptyResultMessage'|trans|sw_sanitize
  67.                                         } %}
  68.                                     {% endblock %}
  69.                                 </div>
  70.                             {% endblock %}
  71.                         {% endif %}
  72.                     </div>
  73.                 {% endblock %}
  74.                 {% if searchResult.total > searchResult.limit %}
  75.                     {% block element_product_listing_pagination_nav_bottom %}
  76.                         {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
  77.                             entities: searchResult,
  78.                             criteria: searchResult.criteria
  79.                         } %}
  80.                     {% endblock %}
  81.                 {% endif %}
  82.             </div>
  83.         {% endblock %}
  84.     </div>
  85. {% endblock %}