custom/plugins/DecomTheme/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.     {% block product_listing_cats %}
  19.         {% set currentCategory = page.header.navigation.tree[ page.navigationId ] %}
  20.         {% if currentCategory.children|length > 1 %}
  21.             {% set sliderConfig = {
  22.                 
  23.             } %}
  24.             {% set baseSliderOptions = {
  25.                 slider: {
  26.                     navPosition: 'bottom',
  27.                     items: 4,
  28.                     speed: 500,
  29.                     loop: false,
  30.                     nav: false,
  31.                     gutter: 30,
  32.                     nav: false,
  33.                     autoHeight: false,
  34.                     startIndex: 1,
  35.                     responsive: {
  36.                         xs: {
  37.                             items: 1,    
  38.                             gutter: 0,                    
  39.                             nav: true,
  40.                         },
  41.                         sm: {
  42.                             items: 1,  
  43.                             gutter: 0,                      
  44.                             nav: true,
  45.                         },
  46.                         md: {
  47.                             items: 2,
  48.                             gutter: 20,
  49.                             nav: true,
  50.                         },
  51.                         lg: {
  52.                             items: 2,
  53.                             gutter: 20,
  54.                             nav: true,
  55.                         }
  56.                     }
  57.                 }
  58.             } %}
  59.             
  60.             <div class="category-children base-slider"
  61.                 data-base-slider="true"
  62.                 data-base-slider-options='{{ baseSliderOptions|json_encode }}'>
  63.                 <div class="base-slider-container"
  64.                     data-base-slider-container="true">
  65.                     {% for subCat in currentCategory.children|slice(0, 4) %}
  66.                         {% if subCat.category.media.url is defined %}
  67.                             <div class="base-slider-item">
  68.                                 <a href="{{ category_url( subCat.category ) }}" class="category-child">                    
  69.                                     <div class="category-image">
  70.                                         <img src="{{ subCat.category.media.url }}" alt="{{ subCat.category.name }}">
  71.                                     </div>                    
  72.                                     <div class="category-info">
  73.                                         <button class="btn btn-primary">
  74.                                             {{ subCat.category.translated.name }}
  75.                                         </button>                            
  76.                                     </div>
  77.                                 </a>
  78.                             </div>
  79.                         {% endif %}
  80.                     {% endfor %}
  81.                 </div>
  82.                 
  83.                 <div class="category-slider-controls-container">
  84.                     <div class="base-slider-controls"
  85.                         data-base-slider-controls="true">
  86.                         {% block element_category_slider_controls_items %}
  87.                             {% block element_category_slider_controls_items_arrows %}
  88.                                 <button class="base-slider-controls-prev category-slider-controls-prev{% if sliderConfig.navigationArrows.value == "outside" %} is-nav-prev-outside{% elseif sliderConfig.navigationArrows.value == "inside" %} is-nav-prev-inside{% endif %}">
  89.                                     {% block element_category_slider_controls_items_prev_icon %}
  90.                                         {% sw_icon 'arrow-head-left' %}
  91.                                     {% endblock %}
  92.                                 </button>
  93.                                 <button class="base-slider-controls-next category-slider-controls-next{% if sliderConfig.navigationArrows.value == "outside" %} is-nav-next-outside{% elseif sliderConfig.navigationArrows.value == "inside" %} is-nav-next-inside{% endif %}">
  94.                                     {% block element_category_slider_controls_items_next_icon %}
  95.                                         {% sw_icon 'arrow-head-right' %}
  96.                                     {% endblock %}
  97.                                 </button>
  98.                             {% endblock %}
  99.                         {% endblock %}
  100.                     </div>
  101.                 </div>
  102.             </div>
  103.         {% endif %}
  104.     {% endblock %}
  105.     <div class="cms-element-product-listing-wrapper"
  106.          data-listing-pagination="true"
  107.          data-listing-pagination-options='{{ paginationConfig }}'
  108.          data-listing="true"
  109.          data-listing-options='{{ listingPagination|json_encode }}'>
  110.         {% block element_product_listing_wrapper_content %}
  111.             <div class="cms-element-product-listing">
  112.                 {% if searchResult.total > 0 %}
  113.                     {% block element_product_listing_pagination_nav_actions %}
  114.                         <div class="cms-element-product-listing-actions row justify-content-between">
  115.                             <div class="col-md-auto">
  116.                                 {% if searchResult.total != '' %}
  117.                                     <span class="listing-count">
  118.                                         {{ "checkout.itemCounter"|trans({'%count%': searchResult.total})|sw_sanitize }}
  119.                                     </span>
  120.                                 {% endif %}
  121.                             </div>
  122.                             <div class="col-md-auto">
  123.                                 {% block element_product_listing_sorting %}
  124.                                     {% sw_include '@Storefront/storefront/component/sorting.html.twig' with {
  125.                                         current: searchResult.sorting,
  126.                                         sortings: searchResult.availableSortings
  127.                                     } %}
  128.                                 {% endblock %}
  129.                             </div>
  130.                         </div>
  131.                     {% endblock %}
  132.                 {% endif %}
  133.                 {% block element_product_listing_row %}
  134.                     <div class="row cms-listing-row js-listing-wrapper">
  135.                         {% if searchResult.total > 0 %}
  136.                             {% block element_product_listing_col %}
  137.                                 {% for product in searchResult %}
  138.                                     <div class="cms-listing-col {{ listingColumns }}">
  139.                                         {% block element_product_listing_box %}
  140.                                             {% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
  141.                                                 'layout': boxLayout,
  142.                                                 'displayMode': displayMode
  143.                                             } %}
  144.                                         {% endblock %}
  145.                                     </div>
  146.                                 {% endfor %}
  147.                             {% endblock %}
  148.                         {% else %}
  149.                             {% block element_product_listing_col_empty %}
  150.                                 <div class="cms-listing-col col-12">
  151.                                     {% block element_product_listing_col_empty_alert %}
  152.                                         {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  153.                                             type: 'info',
  154.                                             content: 'listing.emptyResultMessage'|trans|sw_sanitize
  155.                                         } %}
  156.                                     {% endblock %}
  157.                                 </div>
  158.                             {% endblock %}
  159.                         {% endif %}
  160.                     </div>
  161.                 {% endblock %}
  162.                 {% if searchResult.total > searchResult.limit %}
  163.                     {% block element_product_listing_pagination_nav_bottom %}
  164.                         {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
  165.                             entities: searchResult,
  166.                             criteria: searchResult.criteria
  167.                         } %}
  168.                     {% endblock %}
  169.                 {% endif %}
  170.             </div>
  171.         {% endblock %}
  172.     </div>
  173. {% endblock %}