themes/BootstrapChildTheme/SyliusShopBundle/views/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 hasDiscount = variant|sylius_has_discount({'channel': sylius.channel}) %}
  4. {% set appliedPromotions = variant.getChannelPricingForChannel(sylius.channel).getAppliedPromotions() %}
  5. {% set taxon = product.mainTaxon %}
  6. {% include '@SyliusShop/Product/Show/_catalogPromotionLabels.html.twig' with {'appliedPromotions': appliedPromotions, 'withDescription': true} %}
  7. <span class="ui huge header {% if hasDiscount %}has_discount{% endif %}"{% if hasDiscount %} style="color:#DF0000;" {% endif %}  id="product-price" {{ sylius_test_html_attribute('product-price', money.calculatePrice(variant)) }}>
  8.     {{ money.calculatePrice(variant) }}
  9. </span>
  10. {% if taxon is not null and taxon.code in ['storyteller', 'headphones'] %}
  11.     <span class="ui small header free-delivery">
  12.         {{ 'sylius.pages.content.freeDeliveryFrance.title' | trans }}
  13.     </span>
  14. {% endif %}
  15. <span class="ui small header" id="product-original-price"{% if not hasDiscount %} style="display: none;"{% endif %} {{ sylius_test_html_attribute('product-original-price', money.calculateOriginalPrice(variant)) }}>
  16.     {% if hasDiscount %}
  17.         <del>{{ money.calculateOriginalPrice(variant) }}</del>
  18.     {% endif %}
  19. </span>
  20. <script>
  21.     let price = document.getElementById('product-price').innerHTML;
  22.     let title = document.getElementById('sylius-product-name').innerHTML;
  23.     console.log(price);
  24.     console.log(title);
  25.     if(parseInt(price) === 0 && title.includes('quiz')){
  26.         document.getElementById('product-price').innerHTML = "";
  27.     }
  28. </script>