themes/webapicTheme/templates/products/petite_touche_product.html.twig line 1

Open in your IDE?
  1. {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
  2. <div class="association-ctn-product">
  3.     {% if product.imagesByType('image_product_main') is not empty %}
  4.         {% set source_path = product.imagesByType('image_product_main').first.path %}
  5.         {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  6.         {% set path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  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 path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  11.     {% else %}
  12.         {% set original_path = asset('webapic-theme/images/icon-gmap.png') %}
  13.         {% set path = original_path %}
  14.     {% endif %}
  15.     <a href="{{ path('app_product_variant_show', {'slug': product.slug, 'id': product.id}) }}" class="ui fluid image">
  16.         
  17.         <div class="img-ctn">
  18.             <div class="img-ctn-content">
  19.         
  20.                 <img src="{{ path }}" id="main-image" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }} />
  21.                     {% set path = '' %}
  22.         
  23.                 {% if product.imagesByType('image_product_hover') is not empty %}
  24.                     {% set source_path = product.imagesByType('image_product_hover').first.path %}
  25.                     {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  26.                     {% set path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  27.                 {% elseif product.images.first %}
  28.                     {% set source_path = product.images.first.path %}
  29.                     {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  30.                     {% set path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  31.                 {% endif %}
  32.                 {% if path is not empty %}
  33.                     <img class="hover" src="{{ path }}" id="main-image" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }} />      
  34.                 {% endif %}
  35.                 <div class="add">
  36.                     
  37.                     <button
  38.                         {# href="{{ path('bitbag_sylius_wishlist_plugin_shop_wishlist_add_product', {'productId': product.id}) }}" #}
  39.                         class="bitbag-add-to-wishlist"
  40.                         data-product-name="{{ product.name }}"
  41.                         {{ sylius_test_html_attribute('wishlist-add-product') }}
  42.                     >
  43.                         <i class="heart outline icon"></i>
  44.                         {# {{ 'bitbag_sylius_wishlist_plugin.ui.add_to_wishlist'|trans }} #}
  45.                     </button>
  46.                 
  47.                     <button class="js-add-to-cart" data-url="{{ path('app_cart_add_to_cart_ajax') }}" data-postdata="{{ '{"' ~ product.id ~ '":1}' }}">
  48.                         <img src="{{ asset('webapic-theme/images/icon-panier.svg') }}" class="ui image" />
  49.                     </button>                                    
  50.                 </div>
  51.             </div>     
  52.         </div> 
  53.                 
  54.     </a>
  55. </div>