vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_images.html.twig line 1

  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 path = source_path|imagine_filter(filter|default('sylius_shop_product_large_thumbnail')) %}
  5. {% elseif product.images.first %}
  6.     {% set source_path = product.images.first.path %}
  7.     {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  8.     {% set path = source_path|imagine_filter(filter|default('sylius_shop_product_large_thumbnail')) %}
  9. {% else %}
  10.     {% if use_webpack %}
  11.         {% set original_path = asset('build/shop/images/400x300.png', 'shop') %}
  12.     {% else %}
  13.         {% set original_path = asset('assets/shop/img/400x300.png') %}
  14.     {% endif %}
  15.     {% set path = original_path %}
  16. {% endif %}
  17. <div data-product-image="{{ path }}" data-product-link="{{ original_path }}"></div>
  18. <a href="{{ original_path }}" class="ui fluid image" data-lightbox="sylius-product-image">
  19.     <img src="{{ path }}" id="main-image" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }} />
  20. </a>
  21. {% if product.images|length > 1 %}
  22. <div class="ui divider"></div>
  23. {{ sylius_template_event('sylius.shop.product.show.before_thumbnails', {'product': product}) }}
  24. <div class="ui small images">
  25.     {% for image in product.images %}
  26.     {% if use_webpack %}
  27.         {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : asset('build/shop/images/200x200.png') %}
  28.     {% else %}
  29.         {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : asset('assets/shop/img/200x200.png') %}
  30.     {% endif %}
  31.     <div class="ui image">
  32.     {% if product.isConfigurable() and product.enabledVariants|length > 0 %}
  33.         {% include '@SyliusShop/Product/Show/_imageVariants.html.twig' %}
  34.     {% endif %}
  35.         <a href="{{ image.path|imagine_filter('sylius_shop_product_original') }}" data-lightbox="sylius-product-image">
  36.             <img src="{{ path }}" data-large-thumbnail="{{ image.path|imagine_filter('sylius_shop_product_large_thumbnail') }}" alt="{{ product.name }}" />
  37.         </a>
  38.     </div>
  39.     {% endfor %}
  40. </div>
  41. {% endif %}