custom/plugins/WynTheme/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. {% set productsPerPage = config('core.listing.productsPerPage') %}
  5. {% set visibleProducts = searchResult.limit > searchResult.total ? searchResult.total : searchResult.limit %}
  6. {% set loadMoreConfig = {
  7.   limit: searchResult.limit,
  8.   total: searchResult.total,
  9.   productsPerPage: productsPerPage
  10. } %}
  11. {% if disableEmptyFilter is not defined %}
  12.   {% set disableEmptyFilter = config('core.listing.disableEmptyFilterOptions') %}
  13. {% endif %}
  14. {% set listingPagination = {
  15.   sidebar: sidebar,
  16.   params: params,
  17.   dataUrl: dataUrl,
  18.   filterUrl: filterUrl,
  19.   disableEmptyFilter: disableEmptyFilter,
  20.   snippets: {
  21.     resetAllButtonText: 'listing.filterPanelResetAll'|trans|sw_sanitize
  22.   }
  23. } %}
  24. {% block product_listing %}
  25.   {% block element_product_listing_pagination_nav_actions %}
  26.     <div class="cms-element-product-listing-actions">
  27.       <div class="sorting-and-filter">
  28.         {% block element_product_listing_sorting %}
  29.           {% sw_include '@Storefront/storefront/component/sorting.html.twig' with {
  30.             current: searchResult.sorting,
  31.             sortings: searchResult.availableSortings
  32.           } %}
  33.         {% endblock %}
  34.       </div>
  35.       <div class="active-filters">
  36.         <div class="filter-panel-active-title">
  37.           {{ 'wyn-theme.listing.filterActiveTitle'|trans|sw_sanitize }}
  38.         </div>
  39.         <div class="filter-panel-active-container"></div>
  40.       </div>
  41.     </div>
  42.   {% endblock %}
  43.   <div
  44.     class="cms-element-product-listing-wrapper"
  45.     data-listing-load-more="true"
  46.     data-listing-load-more-options='{{ loadMoreConfig|json_encode }}'
  47.     data-listing="true"
  48.     data-listing-options='{{ listingPagination|json_encode }}'
  49.   >
  50.     {% block element_product_listing_wrapper_content %}
  51.       <div class="cms-element-product-listing">
  52.         {% block element_product_listing_row %}
  53.           <div class="row cms-listing-row js-listing-wrapper {% if searchResult.total == 0 %}cms-listing-row--empty{% endif %}">
  54.             {% if searchResult.total > 0 %}
  55.               {% block element_product_listing_col %}
  56.                 {% for product in searchResult %}
  57.                   {# In Shopware's default, classes {{ listingColumns }} are inserted here,
  58.                      which differ when a sidebar is shown (and may differ for product overview / wishlist /
  59.                      search results). For more flexibility we use a grid layout here. #}
  60.                   <div class="cms-listing-col">
  61.                     {% block element_product_listing_box %}
  62.                       {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  63.                         'layout': boxLayout,
  64.                         'displayMode': displayMode
  65.                       } %}
  66.                     {% endblock %}
  67.                   </div>
  68.                 {% endfor %}
  69.               {% endblock %}
  70.             {% else %}
  71.               {% block element_product_listing_col_empty %}
  72.                 <div class="cms-listing-col col-12">
  73.                   {% block element_product_listing_col_empty_alert %}
  74.                     {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  75.                       type: 'info',
  76.                       content: 'listing.emptyResultMessage'|trans|sw_sanitize
  77.                     } %}
  78.                   {% endblock %}
  79.                 </div>
  80.               {% endblock %}
  81.             {% endif %}
  82.           </div>
  83.         {% endblock %}
  84.         {% if searchResult.total > searchResult.limit %}
  85.           <div class="visible-products-progress">
  86.             <div class="progress">
  87.               <div
  88.                 class="progress-bar" role="progressbar"
  89.                 style="width: {{ 100 * (visibleProducts / searchResult.total) }}%"
  90.                 aria-valuenow="{{ visibleProducts }}"
  91.                 aria-valuemin="{{ productsPerPage }}"
  92.                 aria-valuemax="{{ searchResult.total }}"
  93.               >
  94.               </div>
  95.             </div>
  96.             <div class="progress-info">
  97.               {{ 'wyn-theme.listing.visibleProductsInfo'|trans|replace({
  98.                 '%current%': visibleProducts,
  99.                 '%total%': searchResult.total,
  100.               }) }}
  101.             </div>
  102.             <wyn-button variant="secondary" class="progress-load-more-button js-load-more">
  103.               {{ 'wyn-theme.listing.loadMoreProducts'|trans|sw_sanitize }}
  104.             </wyn-button>
  105.           </div>
  106.         {% endif %}
  107.       </div>
  108.     {% endblock %}
  109.   </div>
  110. {% endblock %}