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. {% elseif product.images.first %}
  7.     {% set source_path = product.images.first.path %}
  8.     {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  9.      {% set zoom_path = source_path|imagine_filter('app_shop_product_show_zoom') %}
  10.     {% set path = source_path|imagine_filter(filter|default('sylius_shop_product_large_thumbnail')) %}
  11. {% else %}
  12.     {% set original_path = '//placehold.it/400x300' %}
  13.      {% set zoom_path = '//placehold.it/500x500' %}
  14.     {% set path = original_path %}
  15. {% endif %}
  16. <div data-product-image="{{ path }}" data-product-link="{{ original_path }}" class="big-img ">
  17. <a href="{{ zoom_path}}" class="zoomable" id="bigLink"> 
  18.     <img  id="big" class="img-fluid  w-100" src="{{ zoom_path}}" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }}/>
  19. </a>
  20. {% if product.callouts is not null %}
  21.     {% include "@SetonoSyliusCalloutPlugin/Shop/Product/Callout/_callouts.html.twig" with {'callouts' : product.callouts|setono_callouts} %}
  22. {% endif %} 
  23. </div>
  24. {% if product.images|length > 1 %} 
  25. {{ sylius_template_event('sylius.shop.product.show.before_thumbnails', {'product': product}) }}
  26. <div class="supp-img ">
  27.     <div class="row mt-3">
  28.         {% for image in product.images %}
  29.         {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : '//placehold.it/200x200' %}
  30.         <div class="col-4" data-js-product-thumbnail>
  31.         {% if product.isConfigurable() and product.variants|length > 0 %}
  32.             {% include '@SyliusShop/Product/Show/_imageVariants.html.twig' %}
  33.         {% endif %}
  34.             <a href="javascript:void(0);" class=""   onclick="changeImg('{{ image.path|imagine_filter('sylius_shop_product_large_thumbnail') }}','{{ image.path|imagine_filter('app_shop_product_show_zoom') }} ');" >
  35.                 <img class="img-fluid w-100" src="{{ path }}" data-large-thumbnail="{{ image.path|imagine_filter('sylius_shop_product_large_thumbnail') }}" alt="{{ product.name }}" />
  36.             </a>
  37.         </div>
  38.         {% endfor %}  
  39.     </div>
  40. </div>
  41. {% endif %}