themes/BootstrapTheme/templates/bundles/SyliusShopBundle/Product/Show/_price.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 = variant.getChannelPricingForChannel(sylius.channel) %}
  4. {%  set percentage =  channelpricing.getDiscountedPercentage %}
  5. <div class="picto-promo" {% if percentage and percentage > 0 %} style="display:inline-block" {% else %} style="display:none" {% endif %}>
  6.     <strong><span data-js-product-percentage  >
  7.         {% if channelpricing.discountedPrice and channelpricing.price > channelpricing.discountedPrice  %}
  8.             {{ percentage|round(0) }}%
  9.         {% endif %}
  10.         </span>
  11.     </strong>
  12. </div>
  13. <span class="article-normal  line-through" data-js-product-discounted-price   {{ sylius_test_html_attribute('product-price', money.calculatePrice(product|sylius_resolve_variant)) }}>
  14.     {%  set variant = product|sylius_resolve_variant %}
  15.     {% set channelpricing = variant.getChannelPricingForChannel(sylius.channel) %}
  16.     {% if channelpricing.discountedPrice and channelpricing.price > channelpricing.discountedPrice  %}
  17.         {{ money.convertAndFormat(channelpricing.price)}}
  18.     {% endif %}
  19. </span>
  20. <strong data-js-product-price id="product-price" class="article-promo">{{ money.calculatePrice(product|sylius_resolve_variant) }}</strong>