themes/webapicTheme/templates/site_product_show.html.twig line 1

Open in your IDE?
  1. {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
  2. {% extends '@SyliusShop/layout.html.twig' %}
  3. {% block title %}{{ variant.name }} - {{ parent() }}{% endblock %}
  4. {% block metatags %}
  5.     {{ parent() }}
  6.     {% if app.request.locale|slice(0, 2) == 'en' %}
  7.         <meta name="description" content="{{ variant.name }} - Our tips for accessorizing it and matching it with our other products. Free delivery in store - Choose your color of {{ variant.product.name }}" />
  8.     {% else %}
  9.         <meta name="description" content="{{ variant.name }} - Nos astuces pour l’accessoiriser et l’assortir à nos autres produits. Livraison gratuite en boutique - Choisissez votre coloris de {{ variant.product.name }}" />
  10.     {% endif %}
  11. {% endblock %}
  12. {% block javascripts %}
  13. {{ parent() }}
  14. <script charset="utf-8" src="https://cl.avis-verifies.com/fr/cache/5/2/2/522a8f1f-9ade-fc14-a9e5-7424335e0efd/AWS/PRODUCT_API/tag.min.js"></script> 
  15. {% endblock %}
  16. {% block content %}
  17. <div class="product-page {% if variant.product.conditioning == 'card_kdo_per_euros_each_10_euros' %} kdo-product-page{% endif %}">
  18.     {# Fil d'ariane #}
  19.     {{ wo_render_breadcrumbs() }}
  20. {# {{dump(variant.optionValues[0])}} #}
  21. {# {{dump(variant)}} #}
  22.     {# Page produit = page d'une déclinaison produit #}
  23.     <div class="ui two column stackable grid product-ctn">
  24.         <div class="product-ctn-left">
  25.             {# Images du produits #}
  26.             <div class="images-ctn">
  27.                 {% if is_mobile() and not is_device('iPad') %}
  28.                                         <div class="flag">
  29.                                                 {% include 'partials/block-callout.html.twig' with {'callout': variant.badge} only %}
  30.                                                 {# Octobre Rose #}
  31.                                                 {# {% if variant.optionValues[0].code == "PL.RO.FU" %}
  32.                                                     <img class="lazy oct-rose" src="{{ asset('webapic-theme/images/2024_oct-rose_ruban-fiche.svg') }}" alt="Octobre Rose" />
  33.                                                 {% else %}
  34.                                                     {% include 'partials/block-callout.html.twig' with {'callout': variant.badge} only %}
  35.                                                 {% endif %} #}
  36.                                         </div>
  37.                     {% if variant.product.images|length > 0 %} 
  38.                         <div class="images-mobiles">
  39.                             {% for image in variant.imagesByType('image_product_main')|merge(variant.imagesByType('image_product_secondary')) %}
  40.                                 {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_large_thumbnail') : asset('assets/shop/img/200x200.png') %}
  41.                                 {% set original_path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_original') : asset('assets/shop/img/200x200.png') %}
  42.                                 <a href="{{ original_path }}" class="ui fluid image  image{{ loop.index }} variantimageright{{ variant.imagesByType('image_product_main')|merge(variant.imagesByType('image_product_secondary'))|length }}" data-lightbox="sylius-product-image" data-idvariant="{{ variant.id }}">
  43.                                     <img class="lazyload" data-src="{{ path }}" alt="{{ variant.name }}" />
  44.                                 </a>
  45.                             {% endfor %}
  46.                         </div>
  47.                     {% endif %}
  48.                 {% else %}
  49.                     {% if variant.product.images|length > 1 %}
  50.                         <div class="ui small images images-left">
  51.                             <div class="images-left-sticky">
  52.                                
  53.                                 {% for image in variant.imagesByType('image_product_main')|merge(variant.imagesByType('image_product_secondary')) %}
  54.                                     {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : asset('assets/shop/img/200x200.png') %}
  55.                                 
  56.                                     <div class="ui image variantimageleft{{ variant.imagesByType('image_product_main')|merge(variant.imagesByType('image_product_secondary'))|length }}" data-idvariant="{{ variant.id }}">
  57.                                         <a href="{{ image.path|imagine_filter('sylius_shop_product_original') }}">
  58.                                             <img class="lazyload" data-src="{{ path }}" data-large-thumbnail="{{ image.path|imagine_filter('sylius_shop_product_large_thumbnail') }}" alt="{{ variant.name }}" />
  59.                                         </a>
  60.                                     </div>
  61.                                 {% endfor %}
  62.                             
  63.                             </div>
  64.                         </div>
  65.                     {% endif %}
  66.                     <div class="images-right">
  67.                         <div class="flag">
  68.                             {% include 'partials/block-callout.html.twig' with {'callout': variant.badge} only %}
  69.                                                         {# Octobre Rose #}
  70.                                                         {# {% if variant.optionValues[0].code == "PL.RO.FU" %}
  71.                                                             <img class="lazy oct-rose" src="{{ asset('webapic-theme/images/2024_oct-rose_ruban-fiche.svg') }}" alt="Octobre Rose" />
  72.                                                         {% else %}
  73.                                                             {% include 'partials/block-callout.html.twig' with {'callout': variant.badge} only %}
  74.                                                         {% endif %} #}
  75.                         </div>
  76.                         {# Icones enduction - enduit #}
  77.                         {# {% if variant.coatingType is not empty %}
  78.                         <div class="flag enduit">
  79.                             {% if variant.coatingVegetal == true %}
  80.                             <img src="{{ asset('webapic-theme/images/produit-enduit-vegetal.svg') }}" class="ui image" />
  81.                             {% endif %}
  82.                             {% if variant.coatingType == 'coating_mat' %}
  83.                             <img src="{{ asset('webapic-theme/images/produit-enduit-exterieur.svg') }}" class="ui image" />
  84.                             <img src="{{ asset('webapic-theme/images/produit-enduit-mat.svg') }}" class="ui image" />
  85.                             {% elseif variant.coatingType == 'coating_brillant' %}
  86.                             <img src="{{ asset('webapic-theme/images/produit-enduit-exterieur.svg') }}" class="ui image" />
  87.                             <img src="{{ asset('webapic-theme/images/produit-enduit-brillant.svg') }}" class="ui image" />
  88.                             {% elseif variant.coatingType == 'coating_inner' %}
  89.                             <img src="{{ asset('webapic-theme/images/produit-enduit-interieur.svg') }}" class="ui image" />
  90.                             {% elseif variant.coatingType == 'fabric_heat_sealed' %}
  91.                             <img src="{{ asset('webapic-theme/images/produit-enduit-thermocolle.svg') }}" class="ui image" />
  92.                             {% endif %}
  93.                         </div>
  94.                         {% endif %}                         #}
  95.                        
  96.                         {% for image in variant.imagesByType('image_product_main')|merge(variant.imagesByType('image_product_secondary')) %}
  97.                             {% set path = image.path is not null ? image.path|imagine_filter('app_product_big_main_picture') : asset('assets/shop/img/200x200.png') %}
  98.                             {% set original_path = image.path is not null ? image.path|imagine_filter('app_product_big_main_picture') : asset('assets/shop/img/200x200.png') %}
  99.                             
  100.                             <a href="{{ original_path }}" class="ui fluid image  image{{ loop.index }} variantimageright{{ variant.imagesByType('image_product_main')|merge(variant.imagesByType('image_product_secondary'))|length }}" data-lightbox="sylius-product-image" data-idvariant="{{ variant.id }}">
  101.                                 <img class="lazyload" data-src="{{ path }}" alt="{{ variant.name }}" />
  102.                             </a>
  103.                         {% endfor %}
  104.                         
  105.                     </div>
  106.                 {% endif %}
  107.             </div>
  108.             {# Fin - Images du produits #}
  109.         </div>
  110.         <div class="product-ctn-right">
  111.             <div class="product-ctn-right-sticky">
  112.                 {# Titre + Ajout à la liste d'envies #}
  113.                 <div class="titre">
  114.                     <h1 id="sylius-product-name" itemprop="name"  class="ui monster" {{ sylius_test_html_attribute('product-name', variant.name) }}>
  115.                         {{ variant.name|title }}
  116.                     </h1>
  117.                 
  118.                     {% include 'partials/block-add-to-wishlist.html.twig' with {'product': variant} %}
  119.                 </div>
  120.                 {# Avis #}
  121.                 <div class="ui text menu avis">
  122.                     {# Pour les tissus, on affiche les avis de la déclinaison #}
  123.                     {% if variant.code|slice(0, 5) == constant('App\\Doctrine\\ORM\\ProductVariantRepository::PREFIX_CODE_DIVALTO_FABRIC') %}
  124.                     <div class="NETREVIEWS_PRODUCT_STARS" data-product-id="{{ variant.id }}"></div>
  125.                     {% else %}
  126.                     <div class="NETREVIEWS_PRODUCT_STARS" data-product-id="{{ variant.product.id }}"></div>
  127.                     {% endif %}
  128.                 </div>
  129.                 {# Prix #}
  130.                 {% if variant.product.conditioning not in ['card_kdo_per_euros_each_10_euros'] %}
  131.                 <div class="prices-ctn">
  132.                 
  133.                     {% set hasDiscount = variant|sylius_has_discount({'channel': sylius.channel}) %}
  134.                     {% set price = money.calculatePrice(variant) %}
  135.                     {% set originalPrice = money.calculateOriginalPrice(variant) %}
  136.                                         <div id="product-price" {% if price != originalPrice %}class="promo-product-price"{% endif %} {{ sylius_test_html_attribute('product-price', money.calculatePrice(variant)) }}>
  137.                         {% spaceless %}
  138.                         {{ money.calculatePrice(variant) }}
  139.                         {% if variant.product.conditioning == 'per_meter_each_0_5_meter' %}
  140.                         /m
  141.                         {% endif %}
  142.                         {% endspaceless %}
  143.                         {% if variant.badge is defined and variant.badge is not empty and variant.badge == "low_price" and  variant.product.conditioning != 'per_meter_each_0_5_meter'  %}
  144.                             {% set pricebarre = money.convertAndFormat(variant|sylius_calculate_original_price({'channel': sylius.channel}) * 2) %}
  145.                             <span class="original-price">{{ pricebarre }}</span>
  146.                         {% endif %}
  147.                     </div>
  148.                     {% if price != originalPrice %}
  149.                         
  150.                         <div class="original" {{ sylius_test_html_attribute('product-original-price') }}>
  151.                             <del>{{ originalPrice }}</del>
  152.                         </div>
  153.                         
  154.                         {% set marks = variant|sylius_calculate_price({'channel': sylius.channel})|trim %}
  155.                         {% set total = variant|sylius_calculate_original_price({'channel': sylius.channel})|trim %}
  156.                         {% set promo = 100 - ((marks * 100) / total) %}
  157.                         <div class="promo"> 
  158.                             - {{ promo|round(0) }}.00 %
  159.                         </div>
  160.                     {% endif %}
  161.                     {% if variant.pricePerTwo > 0 %}
  162.                     <div class="codepromo">
  163.                         {{ money.convertAndFormat(variant.pricePerTwo) }}
  164.                         <br />
  165.                         {{ 'app.front.produit.lesdeux'|trans }}
  166.                     </div>
  167.                     {% endif %}
  168.                 </div>
  169.                 {% endif %}
  170.                                 {# Liste des déclinaisons disponible #}
  171.                                 <div class="listingfixe">
  172.                                         <div class="listingfixe-ctn">
  173.                                                 <div class="listingfixe-ctn-products">
  174.                                                         <div class="listingfixe-products">
  175.                                                                 {% for rowVariant in allVariants %}
  176.                                                                         {% if rowVariant.hasImages and rowVariant.canAddItem() %}
  177.                                                                                 {% if rowVariant.imagesByType('image_product_main') is not empty %}
  178.                                                                                         {% set source_path = rowVariant.imagesByType('image_product_main').first.path %}
  179.                                                                                         {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  180.                                                                                         {% set path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  181.                                                                                 {% elseif rowVariant.images.first %}
  182.                                                                                         {% set source_path = rowVariant.images.first.path %}
  183.                                                                                         {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  184.                                                                                         {% set path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  185.                                                                                 {% else %}
  186.                                                                                         {% set original_path = asset('webapic-theme/images/icon-gmap.png') %}
  187.                                                                                         {% set path = original_path %}
  188.                                                                                 {% endif %}
  189.                                                                                 <div class="listingfixe-product-ctn {% if rowVariant.id == variant.id %}current{% endif %}">
  190.                                                                                         <a href="{{ path('app_product_variant_show', {'slug': rowVariant.slug, 'id': rowVariant.id}) }}">
  191.                                                                                                 <div class="img-ctn">
  192.                                                                                                         <div class="img-ctn-content">
  193.                                                                                                                 <img src="{{ path }}" id="main-image" alt="{{ rowVariant.name }}" {{ sylius_test_html_attribute('main-image') }}/>
  194.                                                                                                         </div>
  195.                                                                                                 </div>
  196.                                                                                         </a>
  197.                                                                                 </div>
  198.                                                                         {% endif %}
  199.                                                                 {% endfor %}
  200.                                                         </div>
  201.                                                 </div>
  202.                                         </div>
  203.                                 </div>
  204.                                 {# Fin - Liste des déclinaisons disponible #}
  205.                 {# Stock + En boutique #}
  206.                 <div class="stock-ctn">
  207.                     <div class="stock-ctn-left">
  208.                         <img src="{{ asset('webapic-theme/images/icon-produit-stock.svg') }}" class="ui image"/>
  209.                         <span>
  210.                             {% if variant.canAddItem() %}
  211.                                  {{ 'app.front.produit.stock'|trans }}                                
  212.                             {% else %}
  213.                                 {% if variant.getIsBlocked() %}
  214.                                     {{ 'app.front.produit.availablesoon'|trans }}
  215.                                 {% else %}
  216.                                     {{ 'app.front.produit.outstock'|trans }}
  217.                                 {% endif %}
  218.                             {% endif %}
  219.                         </span>
  220.                     </div>
  221.                     <div class="stock-ctn-right">
  222.                         <img src="{{ asset('webapic-theme/images/icon-produit-boutique.svg') }}" class="ui image"/>
  223.                         <a data-url="{{ path('app_product_shops', {'variantId': variant.id}) }}" href="#">
  224.                          {% if app.user and app.user.customer and app.user.customer.favoriteShop %}                              
  225.                                
  226.                             {% if userFavoriteShopStock == 1 %}                                       
  227.                                 {{ 'app.front.produit.disponible'|trans }}
  228.                             {% else %}
  229.                                 {{ 'app.front.produit.indisponible'|trans }}
  230.                             {% endif %}
  231.                             : {{ app.user.customer.favoriteShop.name }}
  232.                                
  233.                         {% else %}                            
  234.                             {{ 'app.front.produit.trouver'|trans }}
  235.                         {% endif %}
  236.                         </a>
  237.                     </div>
  238.                 </div>
  239.                 {# Ajout au panier #}
  240.                 {% if variant.canAddItem() %}
  241.                     <div class="addtocart-ctn" id="sylius-product-selecting-variant" {{ sylius_test_html_attribute('product-selecting-variant') }}>
  242.                         {% if variant.product.conditioning == 'per_meter_each_0_5_meter' %}
  243.                             {% if meter != 0  %}
  244.                                 <div class="quantite-ctn">
  245.                                     <div class="quantite-select">                              
  246.                                     
  247.                                         <select name="select_tissu" id="add-to-cart" data-idproduct="{{ variant.id }}">
  248.                                             {% for i in range(0.5, meter, 0.5) %}
  249.                                                 <option value="{{ i }}"> {{ i }} m</option>
  250.                                             {% endfor %}
  251.                                         </select>
  252.                                         <span></span>
  253.                                     </div>
  254.                                 </div>
  255.                             {% endif %}
  256.                         {% elseif variant.product.conditioning == 'card_kdo_per_euros_each_10_euros' %}
  257.                                                         <div class="quantite-ctn">
  258.                                                                 <div class="quantite-select">
  259.                                                                         <div class="kdo-select-label">{{ 'app.front.panier.votre_montant'|trans }} :</div>
  260.                                                                         <select name="select_tissu" id="add-to-cart" data-idproduct="{{ variant.id }}">
  261.                                                                                 {% for i in range(10, 250, 10) %}
  262.                                                                                         <option value="{{ i }}"> {{ i }} €</option>
  263.                                                                                 {% endfor %}
  264.                                                                         </select>
  265.                                                                         <span></span>
  266.                                                                 </div>
  267.                                                                 <div class="kdo-product-form">
  268.                                                                     <input type="text" name="kdo_mail" placeholder="Email destinataire" id="kdo_mail">
  269.                                                                     <a href="#" class="kdo_infobulle">
  270.                                                                         <span class="kdo_infobulle_declencheur">i</span>
  271.                                                                         <span class="kdo_infobulle_txt">{{ 'app.front.produit.kdogardersecret'|trans }}</span>
  272.                                                                     </a>
  273.                                                                     <input type="text" name="kdo_lastname" placeholder="Nom" id="kdo_lastname">
  274.                                                                     <input type="text" name="kdo_firstname" placeholder="Prénom" id="kdo_firstname">
  275.                                                                     <textarea rows="4" name="kdo_message" placeholder="Votre message" id="kdo_message"></textarea>
  276.                                                                 </div>
  277.                                                         </div>
  278.                         {% else %}
  279.                             <div class="quantite-ctn">
  280.                                 <div class="quantite-input">
  281.                                     <div>
  282.                                         <label for="add-to-cart" class="required"> {{ 'app.front.produit.quantity'|trans }}</label>
  283.                                         <input onkeyup="if(value>{{ variant.countItemStock() }}) value={{ variant.countItemStock() }};" max="{{ variant.countItemStock() }}" type="number" id="add-to-cart" name="sylius_add_to_cart[cartItem][quantity]" class="js-add-to-cart-qty" data-idproduct="{{ variant.id }}" required="required" min="1">
  284.                                     </div>
  285.                                     <div class="inc button">+</div>
  286.                                     <div class="dec button">-</div>
  287.                                 </div>
  288.                             </div>
  289.                         {% endif %}
  290.                         {% if variant.product.conditioning != 'per_meter_each_0_5_meter' or meter != 0 %}
  291.                             <div class="addtocart-action">
  292.                                 <button class="js-add-to-cart lien-saumon" data-url="{{ path('app_cart_add_to_cart_ajax') }}" data-target="#add-to-cart"  data-tissu="{{ isTissu }}" data-iscartekdo="{{ isCarteKdo }}">
  293.                                     <img src="{{ asset('webapic-theme/images/icon-produit-panier.svg') }}" class="ui image" />
  294.                                     {{ 'app.front.panier.achete'|trans }}
  295.                                 </button>
  296.                             </div>
  297.                         {% endif %}
  298.                     </div>
  299.                 {% else %}
  300.                      {# {{ 'app.front.produit.outstock'|trans }} #}
  301.                 {% endif %}
  302.                                 {# Octobre Rose #}
  303.                                 {# {% if variant.optionValues | length  > 0 and variant.optionValues[0].code == "PL.RO.FU" %}
  304.                                     <div class="octobre-rose-encart">
  305.                                         <a href="/collections/classique/plumetis-rose-fuchsia-1" target="_blank"><img src="{{ asset('webapic-theme/images/2024_oct-rose_ruban-fiche-MEA.svg') }}" class="ui image" /></a>
  306.                                         <p><strong>100 % des ventes reversées</strong> à l'association la <span>Ligue contre le cancer</span>. <a href="/collections/classique/plumetis-rose-fuchsia-1" target="_blank">Plus d'infos</a></p>
  307.                                     </div>
  308.                                 {% endif %} #}
  309.                 <div class="ui hidden divider"></div>
  310.                 {# Accessoires ou bien un bloc image "Sac&Zip" #}
  311.                 {# {{ dump(variant) }} #}
  312.                 {# {% if variant.product.imagesByType('image_product_mea_saczip')|length > 0  %} #}
  313.                 {# {% if produitConfigurateur == 1  %}
  314.                     <div>
  315.                         <a href="{{ path('app_configurateur', {'baseVariantId': variant.id}) }}">
  316.                                                         {% if app.request.locale|slice(0, 2) == 'en' %}
  317.                                                                 <img src="{{ asset('webapic-theme/images/bloc-bt-sac-and-zip_en.png') }}" class="ui image" />
  318.                                                         {% else %}
  319.                                                                 <img src="{{ asset('webapic-theme/images/bloc-bt-sac-and-zip.png') }}" class="ui image" />
  320.                                                         {% endif %}
  321.                         </a>
  322.                     </div>
  323.                  {% elseif associationAccessoire is not empty and accessoires|length > 0 %}  #}   
  324.                                  {% if associationAccessoire is not empty and accessoires|length > 0 %}       
  325.                     <div class="accessoires">
  326.                         <div class="accessoires-ctn">
  327.                             <h2 class="titre"><strong>{{ 'app.front.produit.accessoire1'|trans }}</strong> {{ 'app.front.produit.accessoire2'|trans }} :</h2>
  328.                                                 
  329.                             <div class="association-ctn" id="sylius-product-association-{{ associationAccessoire.type.code }}" {{ sylius_test_html_attribute('product-association', associationAccessoire.type.name) }}>
  330.                                 <div class="caroussel">
  331.                                     {% for product in accessoires %}
  332.                                         {% if product.hasImages and product.canAddItem() %}
  333.                                             <div class="association-ctn-product">
  334.                                                 {% if product.imagesByType('image_product_main') is not empty %}
  335.                                                     {% set source_path = product.imagesByType('image_product_main').first.path %}
  336.                                                     {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  337.                                                     {% set path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  338.                                                 {% elseif product.images.first %}
  339.                                                     {% set source_path = product.images.first.path %}
  340.                                                     {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  341.                                                     {% set path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  342.                                                 {% else %}
  343.                                                     {% set original_path = asset('assets/shop/img/400x300.png') %}
  344.                                                     {% set path = original_path %}
  345.                                                 {% endif %}
  346.                                                 <a href="{{ path('app_product_variant_show', {'slug': product.slug, 'id': product.id}) }}" data-idaccessoire="{{ product.id }}" data-idvariant="{{ variant.id }}" data-url="{{ path('app_product_accessoires') }}">
  347.                                                     <div class="hover">{{ 'app.front.produit.accessoire3'|trans }}</div>
  348.                                                     <span class="already">
  349.                                                         <svg width="100%" height="100%" viewBox="0 0 18 14" fill="none" xmlns="http://www.w3.org/2000/svg">
  350.                                                             <path d="M1.74023 6.99999L7.18468 12.4444L16.2587 1.55554" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  351.                                                         </svg>
  352.                                                     </span>
  353.                                                     
  354.                                                     <div class="img-content">
  355.                                                         <img class="lazyload" src="{{ path }}" id="main-image" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }} />
  356.                                                         {% if product.imagesByType('image_product_main') is not empty  and product.imagesByType('image_product_hover') is not empty %}               
  357.                                                             {% set source_path = product.imagesByType('image_product_hover').first.path %}
  358.                                                             {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  359.                                                             {% set path = source_path|imagine_filter(filter|default('sylius_shop_product_large_thumbnail')) %}
  360.                                                             
  361.                                                             <img class="hover lazyload" data-src="{{ path }}" id="main-image" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }} />
  362.                                                         {% endif %}
  363.                                                     </div>    
  364.                                                     <h3 class="title">{{ product.name }}</h3>
  365.                                                     <div class="sylius-product-price price js-base-price-accessory" {{ sylius_test_html_attribute('product-price') }}>{{ money.calculatePrice(product) }}</div>
  366.                                                 </a>
  367.                                             </div>
  368.                                          {% endif %}
  369.                                     {% endfor %}
  370.                                 </div>
  371.                             </div>
  372.                         </div>
  373.                     </div>
  374.                 {% endif %}
  375.                 {# Onglets #}
  376.                 <div class="tabs-ctn">
  377.                     <div class="ui top attached large tabular tabs-top">
  378.                         <a class="item details active" data-tab="details"><h2>{{ 'sylius.ui.details'|trans }}</h2></a>
  379.                         {% if variant.product.attributes|length > 0 or variant.attributes|length > 0 %}
  380.                         <a class="item carac" data-tab="attributes" {{ sylius_test_html_attribute('tab', 'attributes') }}><h2>{{ 'sylius.ui.attributes'|trans }}</h2></a>
  381.                         {% endif %}
  382.                         {% if variant.advantages is not empty or variant.product.advantages is not empty %}
  383.                         <a class="item avantages" data-tab="avantages"><h2>{{ 'app.front.produit.avantages'|trans }}</h2></a>
  384.                         {% endif %}
  385.                         {% if variant.maintenance is not empty or variant.product.maintenance is not empty %}
  386.                         <a class="item entretien" data-tab="entretien"><h2>{{ 'app.front.produit.entretien'|trans }}</h2></a>
  387.                         {% endif %}
  388.                     </div>
  389.                     <div class="tabs-content">
  390.                         <div class="ui bottom attached tab segment details active" data-tab="details" itemprop="description">
  391.                             {% if variant.description is not empty %}
  392.                                 {{ variant.description|raw }}
  393.                             {% elseif variant.product.description is not empty %}
  394.                                 {{ variant.product.description|raw }}
  395.                             {% else %}
  396.                                 {{ 'sylius.ui.no_description'|trans }}.
  397.                             {% endif %}
  398.                         </div>
  399.                         {% if variant.product.attributes|length > 0 or variant.attributes|length > 0 %}
  400.                         <div class="ui bottom attached tab segment" data-tab="attributes">
  401.                             <table id="sylius-product-attributes" class="ui definition table" {{ sylius_test_html_attribute('product-attributes') }}>
  402.                                 <tbody>
  403.                                 {% for attribute in variant.getAttributesByLocale(app.request.locale, app.request.defaultLocale, sylius_base_locale)|sort_by('attribute.position') %}
  404.                                     <tr>
  405.                                         <td class="sylius-product-attribute-name" {{ sylius_test_html_attribute('product-attribute-name', attribute.name) }}>
  406.                                             {{ attribute.name }}
  407.                                         </td>
  408.                                         <td class="sylius-product-attribute-value" {{ sylius_test_html_attribute('product-attribute-value', attribute.name) }}>
  409.                                             {% include [
  410.                                                 '@SyliusShop/Product/Show/Types/'~attribute.attribute.type~'.html.twig',
  411.                                                 '@SyliusAttribute/Types/'~attribute.attribute.type~'.html.twig',
  412.                                                 '@SyliusShop/Product/Show/Types/default.html.twig'
  413.                                             ] with {
  414.                                                 'attribute': attribute,
  415.                                                 'locale': app.request.locale,
  416.                                                 'fallbackLocale': app.request.defaultLocale
  417.                                             } %}
  418.                                         </td>
  419.                                     </tr>
  420.                                 {% endfor %}
  421.                                 {% for attribute in variant.product.getAttributesByLocale(app.request.locale, app.request.defaultLocale, sylius_base_locale)|sort_by('attribute.position') %}
  422.                                     <tr>
  423.                                         <td class="sylius-product-attribute-name" {{ sylius_test_html_attribute('product-attribute-name', attribute.name) }}>
  424.                                             {{ attribute.name }}
  425.                                         </td>
  426.                                         <td class="sylius-product-attribute-value" {{ sylius_test_html_attribute('product-attribute-value', attribute.name) }}>
  427.                                             {% include [
  428.                                                 '@SyliusShop/Product/Show/Types/'~attribute.attribute.type~'.html.twig',
  429.                                                 '@SyliusAttribute/Types/'~attribute.attribute.type~'.html.twig',
  430.                                                 '@SyliusShop/Product/Show/Types/default.html.twig'
  431.                                             ] with {
  432.                                                 'attribute': attribute,
  433.                                                 'locale': app.request.locale,
  434.                                                 'fallbackLocale': app.request.defaultLocale
  435.                                             } %}
  436.                                         </td>
  437.                                     </tr>
  438.                                 {% endfor %}
  439.                                 </tbody>
  440.                             </table>
  441.                         </div>
  442.                         {% endif %}
  443.                         {% if variant.advantages is not empty or variant.product.advantages is not empty %}
  444.                         <div class="ui bottom attached tab segment avantages" data-tab="avantages">
  445.                             {% if variant.advantages is not empty %}
  446.                                 {{ variant.advantages|raw }}
  447.                             {% elseif variant.product.advantages is not empty %}
  448.                                 {{ variant.product.advantages|raw }}
  449.                             {% endif %}
  450.                         </div>
  451.                         {% endif %}
  452.                         {% if variant.maintenance is not empty or variant.product.maintenance is not empty %}
  453.                         <div class="ui bottom attached tab segment entretien" data-tab="entretien">
  454.                             {% if variant.maintenance is not empty %}
  455.                                 {{ variant.maintenance|raw }}
  456.                             {% elseif variant.product.maintenance is not empty %}
  457.                                 {{ variant.product.maintenance|raw }}
  458.                             {% endif %}
  459.                         </div>
  460.                         {% endif %}
  461.                     </div>
  462.                 </div>
  463.                 {# Bandeau #}
  464.                 {% include 'partials/block-bandeau.html.twig' %}
  465.             </div>
  466.         </div>
  467.     </div>
  468.     <div class="product-full">
  469.         {# "J'ajoute ma petite touche" #}
  470.         {% if associationPetiteTouche is not empty and productsPetiteTouche|length > 0 %}
  471.         <div class="petitetouche">
  472.             <div class="petitetouche-left">
  473.                 <div class="portrait">
  474.                     <h2 class="portrait-top">
  475.                         {{ 'app.front.produit.petitetouche1'|trans }}
  476.                         <span>{{ 'app.front.produit.petitetouche2'|trans }}</span>
  477.                     </h2>
  478.                     <div class="portrait-bottom">
  479.                         {% if variant.product.imagesByType('image_product_smalladd_person')|length > 0 %}               
  480.                         <img class="lazyload" data-src="{{ variant.product.imagesByType('image_product_smalladd_person').first.path|imagine_filter('sylius_shop_product_original') }}" id="main-image" alt="{{ variant.product.name }}" />         
  481.                         {% else %}       
  482.                         <img data-src="{{ asset('webapic-theme/images/petitetouche-portrait.jpg') }}" class="ui image lazyload" />
  483.                         {% endif %}
  484.                         <div>
  485.                             {% if variant.product.smallAddText is not empty %}     
  486.                             {{ variant.product.smallAddText|raw }}  
  487.                             {% else %}
  488.                             <strong>Marie</strong> <span>de la boutique de Guérande</span> vous conseille   
  489.                             {% endif %}
  490.                         </div>
  491.                     </div>
  492.                 </div>
  493.                 <div class="gif">
  494.                     {% if variant.product.imagesByType('image_product_smalladd_gif')|length > 0 %}               
  495.                     <img class="hover lazyload" data-src="{{ asset('media/image/' ~ variant.product.imagesByType('image_product_smalladd_gif').first.path) }}" id="main-image" alt="{{ variant.name }}" />  
  496.                     {% else %}       
  497.                     <img data-src="{{ asset('webapic-theme/images/petitetouche-default.gif') }}" class="ui image lazyload" />
  498.                     {% endif %}
  499.                 </div>
  500.             </div>
  501.             <div class="petitetouche-right">
  502.                 <div class="association-ctn" id="sylius-product-association-{{ associationPetiteTouche.type.code }}" {{ sylius_test_html_attribute('product-association', associationPetiteTouche.type.name) }}>
  503.                     {% for product in productsPetiteTouche %}
  504.                         {% include 'products/petite_touche_product.html.twig' with {'product': product} only %}
  505.                     {% endfor %}
  506.                 </div>
  507.             </div>
  508.         </div>
  509.         {% endif %}
  510.         {# Fin "J'ajoute ma petite touche" #}
  511.         {# "Ca match !" #}
  512.         {# On affiche que s'il y a des collections qui matchent et que si la collection du produit possède une page collection #}
  513.         {% if matchingColors|length > 0 and siteCollection is not empty and siteCollection.imagesByType('image_product_background_ca_match')|length > 0 %}
  514.         <div class="match" style="background-image: url('{{ siteCollection is not empty and siteCollection.imagesByType('image_product_background_ca_match')|length > 0 ? siteCollection.imagesByType('image_product_background_ca_match').first.path|imagine_filter('app_product_match_bg') : asset('webapic-theme/images/placeholder-ca-match.jpg') }}')">       
  515.             <div class="match-ctn">
  516.                 <h2 class="title">{{ 'app.front.block.match.titre1'|trans }} <strong>{{ 'app.front.block.match.titre2'|trans }} !</strong></h2>  
  517.                 <div class="match-left">
  518.                     <div class="match-left-content">
  519.                         {% for matchingColor in matchingColorsWithPage|slice(0, 3) %}
  520.                         <a href="{{ path('app_collection_show', {'slugCategory': matchingColor.category, 'slug': matchingColor.slug}) }}" class="lien-bleu">
  521.                             Collection {{ matchingColor.title }}
  522.                         </a>
  523.                         {% endfor %}
  524.                     </div>
  525.                 </div>
  526.                 <div class="match-right">
  527.                     <div class="association-ctn listing1" id="sylius-product-association-ca_match">
  528.                         {% for variant in matchingProducts %}
  529.                             {% if variant.hasImages and variant.canAddItem() %}
  530.                                 {% include 'products/matching_products.html.twig' with {'product': variant} only %}
  531.                             {% endif %}
  532.                         {% endfor %}
  533.                     </div>
  534.                 </div>
  535.             </div>
  536.         </div>
  537.         {% endif %}
  538.         {# Fin "Ca match !" #}
  539.         {# "Les points forts" #}
  540.         {% if variant.product.strongPoints|length > 0 %}
  541.             <div class="taxons-pointsforts">
  542.                 <h2 class="title">Les points forts{# de notre {{ variant.name|lower }}#}</h2>
  543.                 <div class="taxons-pointsforts-ctn">
  544.                     {% for value in variant.product.strongPoints %}
  545.                         <div class="taxons-pointsforts-content">  
  546.                             {% if value.youtube_link is not empty %}
  547.                             <iframe class="youtube-embed" type="text/html" width="100%" height="320" src="{{ value.youtube_link|replace({'watch?v=':'embed/', 'youtu.be/': 'youtube.com/embed/'}) }}" frameborder="0">
  548.                             </iframe>
  549.                             {% elseif value.image_path is not empty %}
  550.                             <img class="ui image lazyload"data-src="{{ asset('product-strong-points/' ~ value.image_path) }}" />
  551.                             {% endif %}
  552.                         </div>
  553.                     {% endfor %}
  554.                 </div>
  555.             </div>
  556.         {% endif %}
  557.         {# Fin "Les points forts" #}
  558.         {# "Faites (vous) plaisir !" #}
  559.         <div class="collection">
  560.             <div class="collection-ctn">
  561.                 <h2>
  562.                     {{ 'app.front.produit.collection1'|trans }}<br/>
  563.                     <span>{{ 'app.front.produit.collection2'|trans }} <span>{{ 'app.front.produit.collection3'|trans }}</span> !</span>
  564.                 </h2>       
  565.                 <div class="collection-left">
  566.                     <div class="listing1">
  567.                         {% for variant in complementaryProductsSameColor %}
  568.                             {% include 'products/single_product_in_circle.html.twig' with {'product': variant} only %}
  569.                         {% endfor %}
  570.                     </div>
  571.                     {% if siteCollection is not empty %}
  572.                         <a href="{{ path('app_collection_show', {'slugCategory': siteCollection.slugLocale, 'slug': siteCollection.slug}) }}" class="link-collection">
  573.                             {{ 'app.front.produit.voircollection'|trans }}
  574.                         </a>
  575.                      {% endif %}
  576.                 </div>
  577.                 {% if complementaryFabric is not empty and complementaryFabric.id != variant.id %}
  578.                 <div class="collection-right">
  579.                     <img class="top ui image" src="{{ asset('webapic-theme/images/collection-fleche.png') }}" />
  580.                     <div id="circle">
  581.                         <img class="ui image" src="{{ asset('webapic-theme/images/txt-tournant-tissu.svg') }}" />  
  582.                     </div>  
  583.                     {% if complementaryFabric.imagesByType('image_product_hover') is not empty %}
  584.                         {% set source_path = complementaryFabric.imagesByType('image_product_hover').first.path %}
  585.                         {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  586.                         {% set path = source_path|imagine_filter(filter|default('sylius_shop_product_large_thumbnail')) %}
  587.                     {% elseif complementaryFabric.images.first %}
  588.                         {% set source_path = complementaryFabric.images.first.path %}
  589.                         {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
  590.                         {% set path = source_path|imagine_filter(filter|default('sylius_shop_product_large_thumbnail')) %}
  591.                     {% else %}
  592.                         {% set original_path = asset('assets/shop/img/400x300.png') %}
  593.                         {% set path = original_path %}
  594.                     {% endif %}
  595.                     
  596.                     <div class="collection-right-product-ctn">
  597.                         <a href="{{ path('app_product_variant_show', {'slug': complementaryFabric.slug, 'id': complementaryFabric.id}) }}">
  598.                             <div class="img-ctn">
  599.                                 <div class=" img-ctn-content">
  600.                                     <img src="{{ path }}" id="main-image" alt="{{ complementaryFabric.name }}" {{ sylius_test_html_attribute('main-image') }} />
  601.                                 </div>     
  602.                             </div>
  603.                             {% set price = money.calculatePrice(complementaryFabric) %}
  604.                             {% set originalPrice = money.calculateOriginalPrice(complementaryFabric) %}
  605.                             <div class="sylius-product-price price" {{ sylius_test_html_attribute('product-price') }}>
  606.                                 <span>{{ 'app.front.global.apartir'|trans }} </span>
  607.                                 {{ price }}/m
  608.                             </div>
  609.                         </a>
  610.                     </div>
  611.                 </div>
  612.                 {% endif %}
  613.             </div>
  614.         </div>
  615.         {# Fin de "Faites (vous) plaisir !" #}
  616.         {# Article du guide #}
  617.         {% if variant.product.article is not empty %}
  618.             {% include 'partials/block-article-guide.html.twig' with {'article': variant.product.article} only %}
  619.         {% endif %}
  620.         {# Fin de "Article du guide" #}
  621.         {# AVIS/FAQ #}
  622.         <div class="avisfaq">
  623.             <div class="avis">
  624.                 {# Pour les tissus, on affiche les avis de la déclinaison #}
  625.                 {% if variant.code|slice(0, 5) == constant('App\\Doctrine\\ORM\\ProductVariantRepository::PREFIX_CODE_DIVALTO_FABRIC') %}
  626.                 <div class="NETREVIEWS_PRODUCT_REVIEWS" data-product-id="{{ variant.product.id }}"></div>
  627.                 {% else %}
  628.                 <div class="NETREVIEWS_PRODUCT_REVIEWS" data-product-id="{{ variant.product.id }}"></div>
  629.                 {% endif %}
  630.                 {# <div class="NETREVIEWS_PRODUCT_STARS" data-product-id="{{ variant.product.id }}"></div> #}
  631.             </div>
  632.             <div class="faq">
  633.                 <div class="faq-ctn">
  634.                     <h2 class="top">
  635.                         <strong>{{ 'app.front.produit.question1'|trans }}</strong>
  636.                         {{ 'app.front.produit.question2'|trans }}
  637.                     </h2>
  638.                     <ul>
  639.                         {% for siteFaqProduct in siteFaqProducts %}
  640.                         <li>
  641.                             <details>
  642.                                 <summary>{{ siteFaqProduct.question }}</summary>
  643.                                 <div>{{ siteFaqProduct.answer|raw }}</div>
  644.                             </details>
  645.                         </li>
  646.                         {% endfor %}
  647.                     </ul>
  648.                     <div class="bottom">
  649.                         <button class="question">{{ 'app.front.produit.question3'|trans }}</button>
  650.                     </div>
  651.                      <div class="faq-user">
  652.                         {% if is_granted('ROLE_USER') %}
  653.                             <form method="POST" action="{{ path('app_product_send_question') }}">
  654.                                 <label for="question">Ma question</label>
  655.                                 <textarea id="question" name="question" rows="5" cols="33"></textarea>
  656.                                 <input type="hidden" name="variantId" value="{{ variant.id }}" />
  657.                                 <div>
  658.                                     <button type="submit">{{ 'app.front.global.valider'|trans }}</button>
  659.                                 </div>
  660.                             </form>
  661.                         {% else %}
  662.                            <p>{{ 'app.front.produit.question4'|trans }}</p>
  663.                             <a href="{{ path('sylius_shop_login') }}" class="">
  664.                                 {{ 'app.front.produit.login'|trans }}
  665.                             </a>
  666.                         {% endif %}
  667.                     </div>
  668.                 </div>
  669.             </div>
  670.         </div>
  671.         {# Fin FAQ Produit #}
  672.     </div>
  673.     {# Instagram #}
  674.     {% include 'partials/block-instagram.html.twig' %}
  675. </div>
  676. {% if variant.product.conditioning not in ['card_kdo_per_euros_each_10_euros'] %}
  677.     {# <script type="application/ld+json">
  678.     {
  679.         "@context": "https://schema.org/", 
  680.         "@type": "Product", 
  681.         "name": "{{ variant.name|title }}",
  682.         {% if variant.images|length > 0 %} 
  683.             "image": "{{ variant.imagesByType('image_product_main').first().path|imagine_filter('sylius_shop_product_original') }}",
  684.         {% endif %} 
  685.         {% if variant.description is not empty %}        
  686.             "description": "{{ variant.description|raw }}",
  687.         {% elseif variant.product.description is not empty %}
  688.             "description": "{{ variant.product.description|raw }}",
  689.         {% else %}
  690.             "description": "{{ 'sylius.ui.no_description'|trans }}",        
  691.         {% endif %}   
  692.         "brand": {
  693.             "@type": "Brand",
  694.             "name": "PPMC"
  695.         },
  696.         "offers": {
  697.             "@type": "Offer",
  698.             "url": "https://www.papapiqueetmamancoud.fr{{ path('app_product_variant_show', {'slug': variant.product.slug, 'id': variant.id}) }}",
  699.             "priceCurrency": "EUR",
  700.             "price": "{{ price|replace({'€': ''}) }}",
  701.             "availability": "https://schema.org/InStock"
  702.         },
  703.     
  704.     }
  705.     </script>
  706.      #}
  707.   {% set price = money.calculatePrice(variant) %}
  708. <script type="application/ld+json">
  709. {
  710.     "@context": "http://schema.org/",
  711.     "@type": "Product",
  712.     "name": "{{ variant.name }}",
  713.     {% if variant.images|length > 0 %} 
  714.         "image": "{{ variant.imagesByType('image_product_main').first().path|imagine_filter('sylius_shop_product_original') }}",
  715.     {% endif %} 
  716.      {% if variant.description is not empty %}        
  717.         "description": "{{ variant.description|raw }}",
  718.     {% elseif variant.product.description is not empty %}
  719.         "description": "{{ variant.product.description|raw }}",
  720.     {% else %}
  721.         "description": "{{ 'sylius.ui.no_description'|trans }}",        
  722.     {% endif %}   
  723.     "brand": {
  724.         "@type": "Brand",
  725.         "name": "PPMC"
  726.     },
  727.     {% if variant.canAddItem() %}
  728.         "offers": {
  729.             "@type": "Offer",
  730.             "url": "https://www.papapiqueetmamancoud.fr{{ path('app_product_variant_show', {'slug': variant.product.slug, 'id': variant.id}) }}",
  731.             "priceCurrency": "EUR",
  732.             "price": "{{ price|replace({'€': '',',': '.'}) }}",
  733.             "availability": "https://schema.org/InStock"
  734.         }
  735.     {% else %}
  736.         "offers": {
  737.             "@type": "Offer",
  738.             "url": "https://www.papapiqueetmamancoud.fr{{ path('app_product_variant_show', {'slug': variant.product.slug, 'id': variant.id}) }}",
  739.             "priceCurrency": "EUR",
  740.             "price": "{{ price|replace({'€': '',',': '.'}) }}",
  741.             "availability": "https://schema.org/OutOfStock"
  742.         }
  743.     {% endif %}  
  744. }
  745. </script>
  746. <script type="text/javascript">
  747.     $(document).ready(function() {
  748.        dataLayer.push({ ecommerce: null });  // Clear the previous ecommerce object.
  749.         dataLayer.push({
  750.         event: "view_item",
  751.         ecommerce: {
  752.             currency: "EUR",
  753.             value: {{ price|replace({'€': '',',': '.'}) }},
  754.             items: [
  755.             {
  756.                 item_id: {{ variant.id }},
  757.                 item_name: "{{ variant.name }}",
  758.                 index: 0,
  759.                 item_brand: "PPMC",
  760.                 price: {{ price|replace({'€': '',',': '.'}) }},
  761.                 quantity: {{ variant.countItemStock() }}
  762.             }
  763.             ]
  764.         }
  765.         });
  766.     });
  767. </script>
  768.  {% endif %}
  769. {% endblock %}