custom/plugins/CbaxModulManufacturers/src/Resources/views/storefront/cbax-manufacturer/component/manufacturer/product-listing.html.twig line 1

Open in your IDE?
  1. {% block element_product_listing %}
  2.     {# @var result \Shopware\Core\Framework\DataAbstractionLayer\Search\EntitySearchResult #}
  3.     {% set searchResult = cbaxModulManufacturers['products'] %}
  4.     {% set currentPage = ((searchResult.criteria.offset + 1) / searchResult.criteria.limit )|round(0, 'ceil') %}
  5.     {% set paginationConfig = { page: currentPage }|json_encode %}
  6.     {% set slot = page.cmsPage.firstElementOfType('cbax-product-listing') %}
  7.     {% set filterUrl = null %}
  8.     {% set dataUrl = null %}
  9.     {% if searchResult.currentFilters.navigationId %}
  10.         {% set filterUrl = url('frontend.cms.navigation.filter', { navigationId: searchResult.currentFilters.navigationId }) %}
  11.         {% set dataUrl = url('frontend.cms.navigation.page', { navigationId: searchResult.currentFilters.navigationId }) %}
  12.     {% endif %}
  13.     {% set dataUrl = seoUrl('frontend.cbax.manufacturer.detail', { id: dataUrlExtraParam|slice(1)})  %}
  14.     {% set sidebar = sectionType == 'sidebar' ? true : false %}
  15.     {% set params = { slots: slot.id } %}
  16.     {# aktive Filter DIV - wird für die Pagenierung benötigt #}
  17.     <div class="filter-panel-active-container"></div>
  18.     <div class="manufacturer-detail-product-listing">
  19.         <div class="cms-element-product-listing-wrapper"
  20.              data-listing-pagination="true"
  21.              data-listing-pagination-options='{{ paginationConfig }}'
  22.              data-listing="true"
  23.              data-listing-options='{
  24.                  "sidebar": "{{ sidebar }}",
  25.                  "params": {{ params|json_encode }},
  26.                  "dataUrl": "{{ dataUrl }}",
  27.                  "filterUrl": "{{ filterUrl }}",
  28.                  "snippets": {
  29.                     "resetAllButtonText": "{{ 'listing.filterPanelResetAll'|trans }}"
  30.                  }
  31.              }'>
  32.             <div class="cms-element-product-listing">
  33.                 {% if searchResult.total > 0 %}
  34.                     {% block element_product_listing_pagination_nav_actions %}
  35.                         <div class="cms-element-product-listing-actions row justify-content-between">
  36.                             {% block element_product_listing_pagination_nav_top %}
  37.                                 {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
  38.                                     entities: searchResult,
  39.                                     criteria: searchResult.criteria
  40.                                 } %}
  41.                             {% endblock %}
  42.                         </div>
  43.                     {% endblock %}
  44.                 {% endif %}
  45.                 {% block element_product_listing_row %}
  46.                     <div class="row cms-listing-row js-listing-wrapper">
  47.                         {% if searchResult.total > 0 %}
  48.                             {% block element_product_listing_col %}
  49.                                 {% for product in searchResult %}
  50.                                     <div class="cms-listing-col {{ productBoxStyle }}">
  51.                                         {% block element_product_listing_box %}
  52.                                             {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  53.                                                 'layout': productBoxLayout,
  54.                                                 'displayMode': productBoxLayout
  55.                                             } %}
  56.                                         {% endblock %}
  57.                                     </div>
  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
  67.                                         } %}
  68.                                     {% endblock %}
  69.                                 </div>
  70.                             {% endblock %}
  71.                         {% endif %}
  72.                     </div>
  73.                 {% endblock %}
  74.                 {% if searchResult.total > 0 %}
  75.                     {% block element_product_listing_pagination_nav_bottom %}
  76.                         <div class="cms-element-product-listing-actions row justify-content-between">
  77.                             {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
  78.                                 entities: searchResult,
  79.                                 criteria: searchResult.criteria
  80.                             } %}
  81.                         </div>
  82.                     {% endblock %}
  83.                 {% endif %}
  84.             </div>
  85.          </div>
  86.     </div>
  87. {% endblock %}