themes/BootstrapTheme/templates/bundles/SyliusShopBundle/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. {% if variant is not null %}
  4.     {% set channelpricing = variant.getChannelPricingForChannel(sylius.channel) %}
  5.     {%  set percentage =  channelpricing.getDiscountedPercentage %}
  6. {% endif %}
  7. <div class="articleBit" {{ sylius_test_html_attribute('product') }}>
  8.     <div class="bg-art-w">
  9.         <div class="articleBit-ima">
  10.             <a href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}">
  11.                 {% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': product, 'class': 'card-img-top'}  %}
  12.             </a>
  13.             {% if product.callouts is not null %}
  14.                 {% include "@SetonoSyliusCalloutPlugin/Shop/Product/Callout/_callouts.html.twig" with {'callouts' : product.callouts|setono_callouts} %}
  15.             {% endif %}
  16.             {% if variant is not null %}
  17.                 {% if channelpricing.discountedPrice and channelpricing.price > channelpricing.discountedPrice  %}
  18.                     <div class="picto-promo">
  19.                         <strong>
  20.                     <span data-js-product-percentage  >
  21.                         -{{ percentage|round(0) }}%
  22.                     </span>
  23.                         </strong>
  24.                     </div>
  25.                 {% endif %}
  26.             {% endif %}
  27.         </div>
  28.         <div class="max-art">
  29.             <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>
  30.             {% if not product.variants.empty() %}
  31.                 <div class="articleBit-prix">
  32.                     <span class="prix-old" data-js-product-discounted-price   {{ sylius_test_html_attribute('product-price', money.calculatePrice(product|sylius_resolve_variant)) }}>
  33.                         {% if channelpricing.discountedPrice and channelpricing.price > channelpricing.discountedPrice %}
  34.                             {{ money.convertAndFormat(channelpricing.price)}}
  35.                         {% endif %}
  36.                     </span>
  37.                     <strong class="prix-promo"  {{ sylius_test_html_attribute('product-price') }}> {{ money.calculatePrice(variant) }} </strong>
  38.                 </div>
  39.             {% endif %}
  40.         </div>
  41.         <div class="articlebit-detail">
  42.             {% if product.variants.empty() or product.simple and not sylius_inventory_is_available(product.variants.first) %}
  43.                 {% include '@SyliusShop/Product/Show/_outOfStock.html.twig' %}
  44.             {% else %}
  45.                 {{ render(url('sylius_shop_partial_cart_add_item', {'template': '@SyliusShop/Product/Show/_addToCart.html.twig', 'productId': product.id})) }}
  46.             {% endif %}
  47.         </div>
  48.     </div>
  49. </div>
  50.