{% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
{% set accessories = get_products_by_taxon_code('accessories') %}
{% if accessories|length > 1 or (accessories|length == 1 and product != accessories.first) %}
<h4 class="ui horizontal section divider header without-line mt-5 title">{{ 'app.ui.accessories' | trans }}</h4>
<div class="row mb-5">
{% for accessory in accessories|filter(accessory => accessory.code != product.code) %}
<div class="col-sm-6 mb-3">
<div class="product-frame flex">
<a href="{{ path('sylius_shop_product_show', {'slug': accessory.slug}) }}" class="blurring dimmable image">
{% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': accessory, 'bordered': false} %}
</a>
<div class="row">
<div class="col-6 font-weight-bold text-left pl-4">
<a href="{{ path('sylius_shop_product_show', {'slug': accessory.slug}) }}" class="header sylius-product-name" {{ sylius_test_html_attribute('product-name', accessory.name) }}>{{ accessory.name }}</a>
</div>
<div class="col-6">
{% if not accessory.enabledVariants.empty() %}
{% set appliedPromotions = (accessory|sylius_resolve_variant).getAppliedPromotionsForChannel(sylius.channel) %}
{% set price = money.calculatePrice(accessory|sylius_resolve_variant) %}
{% set originalPrice = money.calculateOriginalPrice(accessory|sylius_resolve_variant) %}
{% set taxon = accessory.mainTaxon %}
{# {% set hidePriceForTaxons = ['subscription-packs','story-subscription-packs','welcome-packs','default-packs','teacher', 'special-events','special-events-story', 'special-events-quiz'] %} #}
{% set hidePriceForTaxons = ['subscription-packs','story-subscription-packs','welcome-packs','default-packs','teacher'] %}
{% if taxon is not null %}
{% set displayPrice = true %}
{% for tx in hidePriceForTaxons %}
{% if tx in taxon.slug %}
{% set displayPrice = false %}
{% endif %}
{% endfor %}
{% if displayPrice %}
<div class="sylius-product-price {% if price != originalPrice %}has_discount{% endif %}" {{ sylius_test_html_attribute('product-price') }}>
{{ price }}
{% if price != originalPrice %}
<div class="sylius-product-original-price" {{ sylius_test_html_attribute('product-original-price') }}><del>{{ originalPrice }}</del></div>
{% endif %}
</div>
{% endif %}
{% endif %}
{% include '@SyliusShop/Product/Show/_catalogPromotionLabels.html.twig' with {'appliedPromotions': appliedPromotions, 'withDescription': false} %}
{% endif %}
</div>
</div>
<p class="text-left">{{ ('app.ui.product.storyteller.frames.' ~ accessory.mainTaxon.code) | trans }}</p>
<div class="row pl-4 pr-4">
<a href="{{ path('sylius_shop_product_show', {'slug': accessory.slug}) }}" class="ui button col-sm-4 mr-0">{{ 'app.pages.blog.shop.article.see_more' | trans }}</a>
{{ render(url('sylius_shop_partial_cart_add_item', {'template': '@SyliusShop/Product/Storyteller/_quickAddToCart.html.twig', 'productId': accessory.id })) }}
</div>
</div>
</div>
{% endfor %}
</div>
{% endif %}