themes/webapicTheme/templates/bundles/SyliusShopBundle/Webapic/panier/panier-produits.html.twig line 1

Open in your IDE?
  1. {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
  2. <div class="produits">
  3.     
  4.     {% if app.request.isXmlHttpRequest() and app.request.pathInfo == '/cart/ajax/add-to-cart' %}
  5.         <span class="confirm-add">
  6.             <i class="icon check"></i>{{ 'app.front.panier.confirm'|trans }}
  7.         </span>
  8.     {% endif %}
  9.      <span class="confirm-nostock">
  10.         <i class="icon close"></i>Ce produit n'est plus en stock
  11.     </span>
  12.                
  13.     {% for key, item in cart.items %}
  14.         {% set product_variant = item.variant %}
  15.         {# {{ dump(product_variant.product.conditioning) }} #}
  16.         <div class="produits-item" {{ sylius_test_html_attribute('cart-product-row', item.productName) }}>
  17.             <div class="left">
  18.                 
  19.                 {# {% if product_variant.hasImages %}
  20.                     {% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': product_variant, 'filter': 'app_product_small_thumbnail_listing'} %}
  21.                 {% else %}                    
  22.                     {% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': product_variant.product, 'filter': 'app_product_small_thumbnail_listing'} %}
  23.                 {% endif %} #}
  24.                 {% if product_variant.hasImages %}
  25.                     {% if product_variant.imagesByType('image_product_main') is not empty %}
  26.                         {% set path = product_variant.imagesByType('image_product_main').first.path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  27.                     {% elseif product_variant.images.first %}
  28.                         {% set path = product_variant.images.first.path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  29.                     {% else %}
  30.                         {% set path = asset('assets/shop/img/200x200.png') %}
  31.                     {% endif %}
  32.                 {% else %}    
  33.                         {% if product_variant.product.imagesByType('image_product_main') is not empty %}
  34.                         {% set path = product_variant.product.imagesByType('image_product_main').first.path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  35.                     {% elseif product_variant.product.images.first %}
  36.                         {% set path = product_variant.product.images.first.path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
  37.                     {% else %}
  38.                         {% set path = asset('assets/shop/img/200x200.png') %}
  39.                     {% endif %}
  40.                 {% endif %}
  41.                 <img src="{{ path }}" {{ sylius_test_html_attribute('main-image') }} alt="{{ product_variant.name }}" class="ui bordered image" />
  42.                 {% if product_variant.pricePerTwo > 0 %}
  43.                     <div class="codepromo">
  44.                         {{ money.convertAndFormat(product_variant.pricePerTwo) }}
  45.                         <br />
  46.                         {{ 'app.front.produit.lesdeux'|trans }}
  47.                     </div>
  48.                     {% endif %}
  49.             </div>
  50.             <div class="middle">
  51.                 <a href="{{ path('app_product_variant_show', {'id': product_variant.id, 'slug': product_variant.slug}) }}">
  52.                     <div class="sylius-product-name" {{ sylius_test_html_attribute('product-name', item.productName) }}>                         
  53.                         {% if item.variantName %}
  54.                              {{ item.variantName }}
  55.                         {% else %}                    
  56.                             {{ item.productName }}
  57.                         {% endif %}
  58.                     </div>                                       
  59.                 </a>       
  60.                 
  61.                 <span class="sylius-unit-price" {{ sylius_test_html_attribute('cart-product-unit-price', item.productName) }}>
  62.                     {# {{ money.convertAndFormat(item.discountedUnitPrice) }} #}
  63.                     {{ money.convertAndFormat(item.total) }}
  64.                     {% if item.adjustmentsTotal < 0 %}
  65.                         <span class="original-price"> {{ money.convertAndFormat(item.unitsTotal) }}</span>
  66.                      {% endif %}
  67.                 </span>
  68.                                 {% if product_variant.product.conditioning == 'card_kdo_per_euros_each_10_euros' %}
  69.                                     <br><span class="panierpopup-destination">A destination de {{item.kdoLastname}} {{item.kdoFirstname}} ({{item.kdoEmail}}) <br/>
  70.                                     Message: {{item.kdoMessage}}</span>
  71.                 {% endif %}
  72.             </div>
  73.             
  74.             <div class="right">
  75.                                             
  76.                 <div class="quantite-ctn">
  77.                     <div class="lds-roller-ctn">
  78.                         <div class="lds-roller"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
  79.                     </div>
  80.                     
  81.                     <div class="ui red label bottom pointing hidden sylius-validation-error" id="sylius-cart-validation-error" {{ sylius_test_html_attribute('cart-validation-error') }}></div>
  82.                     <div class="quantite-input">                                    
  83.                       
  84.                         {% if product_variant.product.conditioning != 'per_meter_each_0_5_meter' and product_variant.product.conditioning != 'card_kdo_per_euros_each_10_euros' %}
  85.                             <input name="quantity" value="{{ item.quantity }}"  {% if is_mobile() %}{% else %}readonly{% endif %} autocomplete="off">
  86.                             <div class="dec button" data-url="{{ path('app_cart_update', {id: item.id}) }}" data-qte="{{ item.quantity }}">-</div>
  87.                             {% if item.quantity != 10 and item.canAddItem() %}
  88.                                 <div class="inc button" data-url="{{ path('app_cart_update', {id: item.id}) }}" data-qte="{{ item.quantity }}">+</div>
  89.                             {% endif %}
  90.                         {% else %}                           
  91.                             <div class="dec button" data-url="{{ path('app_cart_update', {id: item.id}) }}" data-qte="{{ item.quantity }}" data-tissu='1'> <i class="icon trash"></i></div>
  92.                         {% endif %}
  93.                     </div>
  94.        
  95.                 </div>
  96.             </div> 
  97.         </div>           
  98.     {% endfor %}
  99. </div>