custom/static-plugins/NdTheme/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. {% if page and page is instanceof('Nd\\Fashion\\Page\\Manufacturer\\ProductManufacturerPage') %}
  3.     {% set dataUrl =  url('frontend.productManufacturer.detail', { productManufacturerId: page.productManufacturerId }) %}
  4.     {% set filterUrl = url('frontend.productManufacturer.detail', { productManufacturerId: page.productManufacturerId }) %}
  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="md:flex items-end justify-between">
  18.         <h1 class="product-listing-name font-display font-bold text-3xl uppercase pt-3 pb-1">{{ page.header.navigation.active.name }}</h1>
  19.         <div class="grid-gap-2 items-center hidden lg:flex">
  20.             <div class="products-per-page flex grid-gap-1 text-sm text-grey-600"
  21.                  data-products-per-page="true">
  22.                 <select name="per-page" id="per-page" class="custom-select !pr-7">
  23.                     {% set numbers = [12, 24, 36, 48, 72] %}
  24.                     {% set getParameter = app.request.query.get('limit') + 0 %}
  25.                     {% for item in numbers %}
  26.                         <option value="{{ item }}"
  27.                                 {% if getParameter === item or searchResult.limit === item %}selected{% elseif loop.first %}{% endif %}>
  28.                             {{ item }}
  29.                         </option>
  30.                     {% endfor %}
  31.                 </select>
  32.             </div>
  33.             {% sw_include '@Storefront/storefront/component/custom-sorting.html.twig' with {
  34.                 current: searchResult.sorting,
  35.                 sortings: searchResult.availableSortings,
  36.                 type: 'select'
  37.             } %}
  38.         </div>
  39.     </div>
  40.     <div class="cms-element-product-listing-wrapper relative"
  41.          data-listing-pagination="true"
  42.          data-listing-pagination-options='{{ paginationConfig }}'
  43.          data-listing="true"
  44.          data-listing-options='{{ listingPagination|json_encode }}'>
  45.         {% block element_product_listing_wrapper_content %}
  46.             <div class="cms-element-product-listing boxed-layout">
  47.                 {% block element_product_listing_header %}
  48.                     <section class="product-listing-header hidden lg:block">
  49.                         <div class="product-listing-header-actions flex justify-between items-center pb-3 pt-1">
  50.                             <div class="show-results text-sm text-grey-600">
  51.                                 {% set totalCurrent = searchResult.limit %}
  52.                                 {% if searchResult.limit > searchResult.total %}
  53.                                     {% set totalCurrent = searchResult.total %}
  54.                                 {% endif %}
  55.                                 {{ 'pages.listing.showingResults'|trans({ '%current%': totalCurrent, '%total%': searchResult.total })|sw_sanitize }}
  56.                             </div>
  57.                         </div>
  58.                     </section>
  59.                 {% endblock %}
  60.                 {% block element_product_listing_row %}
  61.                     <div class="cms-listing-row js-listing-wrapper grid grid-cols-2 grid-gap-2 md:grid-cols-3 xl:grid-cols-4">
  62.                         {% if searchResult.total > 0 %}
  63.                             {% block element_product_listing_col %}
  64.                                 {% for product in searchResult %}
  65.                                     <div class="product-card">
  66.                                         {% block element_product_listing_box %}
  67.                                             {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  68.                                                 'layout': boxLayout,
  69.                                                 'displayMode': displayMode
  70.                                             } %}
  71.                                         {% endblock %}
  72.                                     </div>
  73.                                 {% endfor %}
  74.                             {% endblock %}
  75.                         {% else %}
  76.                             {% block element_product_listing_col_empty %}
  77.                                 <div class="cms-listing-col no-products-found col-span-full">
  78.                                     {% block element_product_listing_col_empty_alert %}
  79.                                         {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  80.                                             type: 'info',
  81.                                             content: 'listing.emptyResultMessage'|trans|sw_sanitize
  82.                                         } %}
  83.                                     {% endblock %}
  84.                                 </div>
  85.                             {% endblock %}
  86.                         {% endif %}
  87.                     </div>
  88.                 {% endblock %}
  89.                 {% if searchResult.total > searchResult.limit %}
  90.                     {% block element_product_listing_pagination_nav_bottom %}
  91.                         {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
  92.                             entities: searchResult,
  93.                             criteria: searchResult.criteria,
  94.                             paginationLocation: 'bottom',
  95.                         } %}
  96.                     {% endblock %}
  97.                 {% endif %}
  98.             </div>
  99.         {% endblock %}
  100.     </div>
  101. {% endblock %}