themes/BootstrapTheme/templates/bundles/SyliusShopBundle/Product/Show/_images.html.twig line 1

Open in your IDE?
  1.     {% if product.imagesByType('main') is not empty %}
  2.         {% set source_path = product.imagesByType('main').first.path %}
  3.         {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  4.         {% set zoom_path = source_path|imagine_filter('app_shop_product_show_zoom') %}
  5.         {% set path = source_path|imagine_filter(filter|default('sylius_shop_product_large_thumbnail')) %}
  6.         {% set alt = product.images.first.alt %}
  7.     {% elseif product.images.first %}
  8.         {% set source_path = product.images.first.path %}
  9.         {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  10.         {% set zoom_path = source_path|imagine_filter('app_shop_product_show_zoom') %}
  11.         {% set path = source_path|imagine_filter(filter|default('sylius_shop_product_large_thumbnail')) %}
  12.         {% set alt = product.images.first.alt %}
  13.     {% else %}
  14.         {% set original_path = asset('images/spacer.png') %}
  15.         {% set zoom_path = original_path %}
  16.         {% set path = original_path %}
  17.         {% set alt = product.name %}
  18.     {% endif %}
  19. {% if alt == "" or alt is null %}
  20.     {% set alt = product.name %}
  21. {% endif %}
  22. {% set productIsInWishlist = false %}
  23. {% if wishlist is not defined or wishlist is null %}
  24.     {% set wishlist = app_get_wishlist() %}
  25. {% endif %}
  26. {% if wishlist is defined and wishlist %}
  27.     {% set productIsInWishlist = wishlist.hasProduct(product) %}
  28. {% endif %}
  29. <div class="mx-md-0 mx-n3">
  30.     <div data-product-image="{{ path }}" data-product-link="{{ original_path }}" class="big-img position-relative">
  31.         <div class="btn-slide2-prev artimg-prev d-none d-md-block"></div>
  32.         <div class="btn-slide2-next artimg-next  d-none d-md-block"></div>
  33.         <div class="swiper-container gallery-art-image">
  34.             <div class="swiper-wrapper">
  35.                 <div class="swiper-slide img-bit-article">
  36.                     <a href="{{ zoom_path}}" class="position-relative overflow-hidden" id="bigLink" data-toggle="lightbox">
  37.                         <img  id="big" class="img-fluid  w-100" src="{{ zoom_path}}" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }}/>
  38.                     </a>
  39.                     {% if product.callouts is not null and product.callouts|length > 0 %}
  40.                         {% include "@SetonoSyliusCalloutPlugin/Shop/Product/Callout/_callouts.html.twig" with {'callouts' : product.callouts|setono_callouts, "spot": "product_image"} %}
  41.                     {% endif %}
  42.                     
  43.                     
  44.                 </div>
  45.                 {% if product.images|length > 1 %}
  46.                     {% set myVal = 0 %}
  47.                     {% for image in product.images %}
  48.                         {% if image.alt is not null %}
  49.                             {% set alt = image.alt %}
  50.                         {% else %}
  51.                             {% set alt = product.name %}
  52.                         {% endif %}
  53.                         {% set myVal = myVal + 1 %}
  54.                         {% if myVal > 1 %}
  55.                         {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : asset('images/spacer.png') %}
  56.                         <div class="img-bit-article swiper-slide" data-js-product-thumbnail>
  57.                             {% if product.isConfigurable() and product.variants|length > 0 %}
  58.                                 {% include '@SyliusShop/Product/Show/_imageVariants.html.twig' %}
  59.                             {% endif %}
  60.                             <a href="{{ image.path|imagine_filter('sylius_shop_product_large_thumbnail') }}" class="" data-toggle="lightbox" data-gallery="test-{{myVal}}" >
  61.                                 {% if app_file_exists((path ~ ".webp")|replace({"resolve/": ""})) %}
  62.                                     <img class="w-100" src="{{ (path ~ ".webp")|replace({'resolve/':''}) }}" data-large-thumbnail="{{ image.path|imagine_filter('sylius_shop_product_large_thumbnail') }}" alt="{{ product.name }}" />
  63.                                 {% else %}
  64.                                     <img class="w-100" src="{{ path }}" data-large-thumbnail="{{ image.path|imagine_filter('sylius_shop_product_large_thumbnail') }}" alt="{{ alt }}" />
  65.                                 {% endif %}
  66.                             </a>
  67.                         </div>
  68.                         {% endif %}
  69.                     {% endfor %}
  70.                 {% endif %}
  71.             </div>
  72.             <div class="position-relative pt-md-3 pt-2 d-flex_ d-md-none_ d-none align-items-center justify-content-center container-pagination">
  73.                 <div class="swiper-pagination swiper-pagination-produit position-relative bottom-0 w-auto"></div>
  74.             </div>
  75.         </div>
  76.     </div>
  77.     <div class="thumbs-img-art d-none d-md-block">
  78.         <div class="swiper-container gallery-thumbs-art"> 
  79.             <div class="swiper-wrapper">
  80.                 <div class="swiper-slide gallery-bit-article ">
  81.                     {% include '@SyliusShop/Product/Show/_video.html.twig' %}
  82.                 </div>
  83.                 {% if product.images|length > 0 %} 
  84.                     {% set myVal2 = 0 %}
  85.                     {{ sylius_template_event('sylius.shop.product.show.before_thumbnails', {'product': product}) }}
  86.                     {% for image in product.images %}
  87.                         {% set myVal2 = myVal2 + 1 %}
  88.                         {% if myVal2 > 0 %}
  89.                             {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : '//placehold.it/200x200' %}
  90.                             <div class="swiper-slide gallery-bit-article " data-js-product-thumbnail>
  91.                                 {% if product.isConfigurable() and product.variants|length > 0 %}
  92.                                     {% include '@SyliusShop/Product/Show/_imageVariants.html.twig' %}
  93.                                 {% endif %}
  94.                                 <a class="cursor-pointer" data-toggle="lightbox" href="{{ image.path|imagine_filter('app_shop_product_show_zoom') }}">
  95.                                     <img class="w-100" src="{{ path }}" data-large-thumbnail="{{ image.path|imagine_filter('app_shop_product_show_zoom') }}" alt="{{ product.name }}" />
  96.                                 </a>
  97.                             </div>  
  98.                             {% endif %} 
  99.                     {% endfor %} 
  100.                 {% endif %}
  101.             </div>
  102.         </div>
  103.     </div>
  104. </div>