themes/BootstrapTheme/SyliusShopBundle/views/Product/Box/_content.html.twig line 1

Open in your IDE?
  1. {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
  2. {%  set variant = product|sylius_resolve_variant %}
  3. {% set channelpricing = null %}
  4. {% if variant is not null %}
  5.     {% set channelpricing = variant.getChannelPricingForChannel(sylius.channel) %}
  6.     {% set percentage =  channelpricing.getDiscountedPercentage %}
  7. {% endif %}
  8. <div class="articleBit h-100" {{ sylius_test_html_attribute('product') }}>
  9.     <div class="bg-art-w  h-100 d-flex flex-column">
  10.         <div class="articleBit-ima   flex-grow-1 d-flex align-items-center justify-content-center">
  11.             <a href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}">
  12.                 {% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': product, 'variant': variant, 'class': 'card-img-top_'}  %}
  13.             </a>
  14.             {% if product.callouts is not null %}
  15.                 {% include "@SetonoSyliusCalloutPlugin/Shop/Product/Callout/_callouts.html.twig" with {'callouts' : product.callouts|setono_callouts} %}
  16.             {% endif %}
  17.         {% if variant is not null %}
  18.             {% if channelpricing.originalPrice > channelpricing.price  %}
  19.             <div class="picto-promo">
  20.                 <strong>
  21.                 <span data-js-product-percentage  >
  22.                     -{{ percentage|round(0) }}%
  23.                 </span>
  24.                 </strong>
  25.             </div>
  26.             {% endif %}
  27.         {% endif %}
  28.         </div>
  29.         <div class="max-art">
  30.             <h3 class="articleBit-lib"  {{ sylius_test_html_attribute('product-name', product.name) }}><div class="table-lib"><a href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}">{{ product.name }}</a></div></h3>
  31.         </div>
  32.         <div class="articlebit-detail">
  33.             <div class="table-ajout-panier">
  34.                     <div class="articleBit-prix">
  35.                          {% if channelpricing and not product.variants.empty() %}
  36.                                 <span class="prix-old" data-js-product-original-price   {{ sylius_test_html_attribute('product-price', money.calculatePrice(product|sylius_resolve_variant)) }}>
  37.                                 {% set variant = product|sylius_resolve_variant %}
  38.                                 {% if channelpricing.originalPrice > channelpricing.price %}
  39.                                     {{ money.convertAndFormat(channelpricing.originalPrice)}}
  40.                                 {% endif %}
  41.                                 </span>
  42.                              {% if channelpricing.price != 0 %}
  43.                                 <strong class="prix-promo"  {{ sylius_test_html_attribute('product-price') }}><em class="d-none">{{'app.product.apartirde' |trans}}</em> {{ money.calculatePrice(product|sylius_resolve_variant) }} </strong>
  44.                             {% endif %}
  45.                         {% endif %}
  46.                     </div>
  47.                     {% if channelpricing and channelpricing.originalPrice > channelpricing.price and channelpricing.discountedPriceEndsAt is not null %}
  48.                         {% set now = "now"|date("U") %}
  49.                         {% set endsAt = channelpricing.discountedPriceEndsAt|date("U") %}
  50.                         {% set diffSeconds = endsAt - now %}
  51.                         {% set days = (diffSeconds // 86400) %}
  52.                         {% set hours = ((diffSeconds % 86400) // 3600) %}
  53.                         {% set minutes = ((diffSeconds % 3600) // 60) %}
  54.                         {% set seconds = (diffSeconds % 60) %}
  55.                             {% if diffSeconds > 0 %}
  56.                                 <div class="encart-promo" >
  57.                                     <strong>{{ 'app.product.current_promotion'|trans }} !</strong>
  58.                                     <span>{{ 'app.product.store_at_the_best_price'|trans }}</span>
  59.                                     <div class="timer" data-ends-at="{{ channelpricing.discountedPriceEndsAt|date('c') }}">
  60.                                         <div class="days"><b>{{ days }}</b> {{ 'app.ui.days'|trans }}</div>
  61.                                         <div class="hours"><b>{{ hours }}</b> {{ 'app.ui.hours'|trans }}</div>
  62.                                         <div class="minutes"><b>{{ minutes }}</b> {{ 'app.ui.minutes'|trans }}</div>
  63.                                         <div class="seconds"><b>{{ seconds }}</b> {{ 'app.ui.secondes'|trans }}</div>
  64.                                     </div>
  65.                                     <div class="content-ajout-panier">
  66.                                         <a class="btn-ajout-panier" href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}"> > {{'app.product.detail'|trans}}</a>
  67.                                     </div>
  68.                                 </div>
  69.                             {% else %}
  70.                                 <div class="content-ajout-panier">
  71.                                     <a class="btn-ajout-panier" href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}"> > {{'app.product.detail'|trans}}</a>
  72.                                 </div>
  73.                             {% endif %}
  74.                     {% elseif product.specialOfferEndsAt %}
  75.                         {% set now = "now"|date("U") %}
  76.                         {% set endsAt = product.specialOfferEndsAt|date("U") %}
  77.                         {% set diffSeconds = endsAt - now %}
  78.                         {% set days = (diffSeconds // 86400) %}
  79.                         {% set hours = ((diffSeconds % 86400) // 3600) %}
  80.                         {% set minutes = ((diffSeconds % 3600) // 60) %}
  81.                         {% set seconds = (diffSeconds % 60) %}
  82.                         {% if diffSeconds > 0 %}
  83.                             <div class="special-offer encart-promo" >
  84.                                 <strong>{{ 'app.product.special_offer'|trans }} !</strong>
  85.                                 <div class="timer" data-ends-at="{{ product.specialOfferEndsAt|date('c') }}">
  86.                                     <div class="days"><b>{{ days }}</b> {{ 'app.ui.days'|trans }}</div>
  87.                                     <div class="hours"><b>{{ hours }}</b> {{ 'app.ui.hours'|trans }}</div>
  88.                                     <div class="minutes"><b>{{ minutes }}</b> {{ 'app.ui.minutes'|trans }}</div>
  89.                                     <div class="seconds"><b>{{ seconds }}</b> {{ 'app.ui.secondes'|trans }}</div>
  90.                                 </div>
  91.                                 <div class="content-ajout-panier">
  92.                                     <a class="btn-ajout-panier" href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}"> > {{'app.product.detail'|trans}}</a>
  93.                                 </div>
  94.                             </div>
  95.                         {% endif %}
  96.                     {% else %}
  97.                         <div class="content-ajout-panier">
  98.                             <a class="btn-ajout-panier" href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}"> > {{'app.product.detail'|trans}}</a>
  99.                         </div>
  100.                     {% endif %}
  101.                 </div>
  102.         </div>
  103.     </div>
  104. </div>