custom/plugins/SsikLibertyTheme/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 listingStyle = config('SsikLibertyTheme.config.listingStyle') %}
  3. {% set productBoxHover = config('SsikLibertyTheme.config.productBoxHover') %}
  4. {% block element_product_listing_pagination_nav_top %}
  5.     {% block ssik_element_product_listing_title_page %}
  6.         <h1 itemprop="name" class="section-title">
  7.             {{page.header.navigation.active.name}}
  8.         </h1>
  9.     {% endblock %}
  10.     {{parent()}}
  11. {% endblock %}
  12. {% block element_product_listing_wrapper_content %}
  13.     <div class="ssik-listing {% if listingStyle is not empty and listingStyle is not same as('default') %}ssik-{{listingStyle}}{% else %}ssik-default{% endif %}"
  14.         {% if listingStyle is not empty and 
  15.             listingStyle is not same as('default') and 
  16.             productBoxHover is same as('imagehover') %}data-product-img-hover="true"{% endif %}>
  17.         {{parent()}}
  18.     </div>
  19. {% endblock %}
  20. {% block element_product_listing_col %}
  21.     {% if listingStyle is not same as('default') %}
  22.         
  23.         {% set aspectRatio = 1 %}
  24.         {% set first = searchResult.elements|first %}
  25.         {% if first and first.cover %}
  26.             {% set cover = first.cover.media %}
  27.             {% set aspectRatio = (cover.metaData['width'] / cover.metaData['height']) %}
  28.         {% endif %}
  29.         {% for product in searchResult %}
  30.             {% if product %}
  31.                     {% set itemRatio = 1 %}
  32.                     {% if product.cover %}
  33.                         {% set cover = product.cover.media %}
  34.                         {% set itemRatio = (cover.metaData['width'] / cover.metaData['height']) %} 
  35.                     {% endif %}
  36.                     {% set aspectRatio = (itemRatio < aspectRatio) ? itemRatio : aspectRatio %} 
  37.             {% endif %}
  38.         {% endfor %}
  39.     {% endif %}   
  40.         
  41.     {{parent()}}
  42. {% endblock %}