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

Open in your IDE?
  1. {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
  2. {% if product.imagesByType('image_product_main') is not empty %}
  3.     {% set source_path = product.imagesByType('image_product_main').first.path %}
  4.     {% set path = source_path|imagine_filter('app_product_small_thumbnail_listing') %}
  5. {% elseif product.images.first %}
  6.     {% set source_path = product.images.first.path %}
  7.     {% set path = source_path|imagine_filter('app_product_small_thumbnail_listing') %}
  8. {% else %}
  9.     {% set path = asset('webapic-theme/images/icon-gmap.png') %}
  10. {% endif %}
  11. <div class="listing1-product-ctn card">
  12.     <a href="{{ path('app_product_variant_show', {'slug': product.slug, 'id': product.id}) }}" class="{% if is_mobile() %}mobile {% else %}desktop{% endif %}">
  13.         
  14.         <div class="img-ctn">
  15.             <div class="flag">
  16.                 {% include 'partials/block-callout.html.twig' with {'callout': product.badge} only %}
  17.             </div>  
  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_secondary') is not empty %}
  24.                     {% set source_path = product.imagesByType('image_product_secondary').first.path %}
  25.                     {% set path = source_path|imagine_filter('app_product_small_thumbnail_listing') %}
  26.                 {% elseif product.imagesByType('image_product_main') is not empty %}
  27.                     {% set source_path = product.imagesByType('image_product_main').first.path %}
  28.                     {% set path = source_path|imagine_filter('app_product_small_thumbnail_listing') %}
  29.                 {% endif %}
  30.                 {% if path is not empty %}
  31.                     <img class="hover" src="{{ path }}" id="main-image" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }} />      
  32.                 {% endif %}
  33.                 {% if is_mobile() %}        
  34.                     <button class="mobile"><i class="chevron left icon"></i></button>
  35.                     <button class="mobile right"><i class="chevron right icon"></i></button>
  36.                 {% endif %}
  37.                 
  38.             </div>
  39.         </div>
  40.         <div class="name">{{ product.name }}</div>     
  41.         {% set price = money.calculatePrice(product) %}
  42.         {% set originalPrice = money.calculateOriginalPrice(product) %}
  43.         {# {% if price != originalPrice %}
  44.             <div class="sylius-product-original-price price" {{ sylius_test_html_attribute('product-original-price') }}><del>{{ originalPrice }}</del></div>
  45.         {% endif %} #}
  46.         <div class="sylius-product-price price"  {{ sylius_test_html_attribute('product-price') }}>{{ price }}</div>
  47.         <div class="add">
  48.             <div class="quantite-input">                                    
  49.                 <input class="js-add-to-cart-qty"  name="quantity" value="1"   data-idproduct="{{ product.id }}">
  50.                 <div class="dec button btncadeau" data-qte="1">-</div>
  51.                 <div class="inc button btncadeau" data-qte="1">+</div>
  52.             </div>
  53.             <button class="js-add-to-cart-cadeau addtocart" data-url="{{ path('app_cart_add_to_cart_ajax') }}" data-postdata="{{ '{"' ~ product.id ~ '":1}' }}">
  54.                 {# <img src="{{ asset('webapic-theme/images/icon-panier.svg') }}" class="ui image" /> #}
  55.                 <img src="{{ asset('webapic-theme/images/icon-panier-small.svg') }}" class="ui image" />
  56.             </button>
  57.         </div>
  58.             
  59.     </a>
  60. </div>