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

Open in your IDE?
  1. {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
  2.         <div class="ui fluid card h-100" {{ sylius_test_html_attribute('product') }}>
  3.             <a href="{{ path('sylius_shop_product_show', {'slug': product.slug}) }}" class="blurring dimmable image">
  4.         {% include '@SyliusShop/Product/Show/_attributesPromotionLabels.html.twig' with {'appliedAttributes': product.getAttributesByLocale(product.translation.locale, sylius_base_locale)|sort_by('attribute.position'), 'withDescription': false} %}
  5.                 <div class="ui dimmer">
  6.                     <div class="content">
  7.                         <div class="center">
  8.                             <div class="ui inverted button">{{ 'sylius.ui.view_more'|trans }}</div>
  9.                         </div>
  10.                     </div>
  11.                 </div>
  12.                 {% if is_product_owned(product) and app.user is defined %}
  13.                     <div class="ui yellow top left attached label">{{ "app.ui.catalog.product.tag.owned"|trans }}</div>
  14.                 {% elseif product.offeredOnly %}
  15.                     <div class="ui yellow top left attached label">{{ 'app.ui.offered_only_badge'|trans }}</div>
  16.                 {% elseif is_product_new(product) %}
  17.                     <div class="ui yellow top left attached label">{{ "app.ui.catalog.product.tag.new"|trans }}</div>
  18.                 {% endif %}
  19.                 {% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': product} %}
  20.             </a>
  21.             <div class="content" {{ sylius_test_html_attribute('product-content') }}>
  22.                 <div class="container">
  23.                     <div class="row price-title">
  24.                         <div class="col-md-7 col-sm-12 pr-0">
  25.                             <a href="{{ path('sylius_shop_product_show', {'slug': product.slug}) }}" class="header sylius-product-name" {{ sylius_test_html_attribute('product-name', product.name) }}>{{ product.name }}</a><br />
  26.                             <div class="prodcut_attributes" {{ sylius_test_html_attribute('product-attributes') }}>
  27.                                 {% if product.attributes|length > 0 %}
  28.                                     {% for attribute in product.getAttributesByLocale(product.translation.locale, sylius_base_locale)|sort_by('attribute.position') %}
  29.                                         <div class="attribute-blocks">
  30.                                             <div class="sylius-product-attribute-value" {{ sylius_test_html_attribute('product-attribute-value', attribute.name) }}>
  31.                                                 {% include [
  32.                                                     '@SyliusShop/Product/Show/Types/'~attribute.attribute.type~'.html.twig',
  33.                                                     '@SyliusAttribute/Types/'~attribute.attribute.type~'.html.twig',
  34.                                                     '@SyliusShop/Product/Show/Types/default.html.twig'
  35.                                                 ] with {
  36.                                                     'attribute': attribute,
  37.                                                     'locale': product.translation.locale,
  38.                                                 } %}
  39.                                             </div>
  40.                                         </div>
  41.                                         {% if loop.last == false  %} <div class="dividing_class">|</div>{% endif %}
  42.                                     {% endfor %}
  43.                                 {% endif %}
  44.                             </div>
  45.                         </div>
  46.                         <div class="col-md-5 col-sm-12">
  47.                             {% if not product.enabledVariants.empty() %}
  48.                                 {% set appliedPromotions = (product|sylius_resolve_variant).getAppliedPromotionsForChannel(sylius.channel) %}
  49.                                 {% set price = money.calculatePrice(product|sylius_resolve_variant) %}
  50.                                 {% set originalPrice = money.calculateOriginalPrice(product|sylius_resolve_variant) %}
  51.                                 {% set taxon = product.mainTaxon %}
  52.                                 {# {% set hidePriceForTaxons = ['subscription-packs','story-subscription-packs','welcome-packs','default-packs','teacher', 'special-events','special-events-story', 'special-events-quiz'] %} #}
  53.                                 {% set hidePriceForTaxons = ['subscription-packs','story-subscription-packs','welcome-packs','default-packs','teacher'] %}
  54.                                 {% if taxon is not null %}
  55.                                 {% set displayPrice = true %}
  56.                                     {% for tx in hidePriceForTaxons %}
  57.                                         {% if tx in taxon.slug %}
  58.                                             {% set displayPrice = false %}
  59.                                         {% endif %}
  60.                                     {% endfor %}
  61.                                     {% if displayPrice %}
  62.                                             <div class="sylius-product-price {% if price != originalPrice %}has_discount{% endif %}" {{ sylius_test_html_attribute('product-price') }}>
  63.                                                 {{ price }}
  64.                                                 {% if price != originalPrice %}
  65.                                                     <div class="sylius-product-original-price" {{ sylius_test_html_attribute('product-original-price') }}><del>{{ originalPrice }}</del></div>
  66.                                                 {% endif %}
  67.                                             </div>
  68.                                     {% endif %}
  69.                                 {% endif %}
  70.                                 {% include '@SyliusShop/Product/Show/_catalogPromotionLabels.html.twig' with {'appliedPromotions': appliedPromotions, 'withDescription': false} %}
  71.                             {% endif %}
  72.                             {{ render(url('sylius_shop_partial_cart_add_item', {'template': '@SyliusShop/Product/_quickAddToCart.html.twig', 'productId': product.id })) }}
  73.                         </div>
  74.                     </div>
  75.                 </div>
  76.             </div>
  77.         </div>