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