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. {% set productIsInWishlist = false %}
  4. {% if wishlist is not defined or wishlist is null %}
  5.     {% set wishlist = app_get_wishlist() %}
  6. {% endif %}
  7. {% if wishlist is defined and wishlist %}
  8.     {% set productIsInWishlist = wishlist.hasProduct(product) %}
  9. {% endif %}
  10. {% if variant is not null %}
  11.     {% set channelpricing = variant.getChannelPricingForChannel(sylius.channel) %}
  12.     {% set percentage = channelpricing.getDiscountedPercentage %}
  13. {% endif %}
  14. {% set stockAvailable = false %}
  15. {% for productVariant in product.variants %}
  16.     {% if sylius_inventory_is_available(productVariant)  %}
  17.         {% set stockAvailable = true %}
  18.     {% endif %}
  19. {% endfor %}
  20. <article class="articleBit h-100" {{ sylius_test_html_attribute('product') }}>
  21.     <div class="bg-art-w  h-100 d-flex flex-column">
  22.         <div class="articleBit-ima">
  23.             <a href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}" title="{{ product.name }}">
  24.                 {% include '@SyliusShop/Product/_mainImage.html.twig' with {'product': product, 'class': 'card-img-top'}  %}
  25.             </a>
  26.             {% if product.callouts is not null and product.callouts|length > 0 %}
  27.                 {% include "@SetonoSyliusCalloutPlugin/Shop/Product/Callout/_callouts.html.twig" with {'callouts' : product.callouts|setono_callouts, 'spot': "box"} %}
  28.             {% endif %}
  29.             {% if variant is not null %}
  30.                 {% if channelpricing.discountedPrice and channelpricing.discountedPrice != channelpricing.price and channelpricing|app_check_promotion_price %}
  31.                     <div class="picto-promo"><span data-js-product-percentage>-{{ percentage|round(0) }}%</span></div>
  32.                 {% endif %}
  33.             {% endif %}
  34.             {% if product is defined and product.brand %}
  35.                 {% if product.brand.images|first != false %}
  36.                     {% set path =  product.brand.images|first.path|imagine_filter(filter|default('sylius_shop_product_original')) %}
  37.                     <div class="brand-logo"><img src="{{ path }}" {{ sylius_test_html_attribute('main-image') }}  class="" /></div>
  38.                 {% endif %}
  39.             {% endif %}
  40.             <a href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}" class="btn-details-hover" title=""><span>{{'sylius.ui.details'|trans}}</span></a>
  41.             
  42.             {% if app.user %}
  43.                 <div class="eti-fav categ-fav" data-id="{{product.id}}">
  44.                     {#<a data-remove-url="{{ path('bitbag_sylius_wishlist_plugin_shop_wishlist_remove_product_variant', { wishlistId: wishlist.id, variantId: variant.id}) }}" title="{{ 'app.ui.add_to_wishlist'|trans }}" {% if productIsInWishlist %}class="addfav toggle-fav myfavoris"{% else %}class="addfav toggle-fav addfav-link"{% endif %} data-option="{{ product.id }}" data-url="{{ path('bitbag_sylius_wishlist_plugin_shop_wishlist_add_product', {'productId': product.id}) }}"></a>#}
  45.                     <a data-remove-url="{{ path('bitbag_sylius_wishlist_plugin_shop_wishlist_remove_product', {'productId': product.id}) }}" title="{{ 'app.ui.add_to_wishlist'|trans }}" {% if productIsInWishlist %}class="addfav toggle-fav myfavoris"{% else %}class="addfav toggle-fav addfav-link"{% endif %} data-option="{{ product.id }}" data-url="{{ path('bitbag_sylius_wishlist_plugin_shop_wishlist_add_product', {'productId': product.id}) }}"></a>
  46.                     <span class="c1-a"><img src="{{ asset('images/icon_dejafav.svg', 'bootstrapTheme') }}"></span>
  47.                     <span class="c2-a"><img src="{{ asset('images/icon_dejafav.svg', 'bootstrapTheme') }}"></span>
  48.                 </div>
  49.             {% endif %}
  50.             
  51.         </div>
  52.         <div class="flex-grow-l position-relative_  d-flex flex-column ">
  53.             <div class="max-art flex-grow-l d-flex flex-column justify-content-between ">
  54.                 <h3 class="articleBit-lib" {{ sylius_test_html_attribute('product-name', product.name) }}>
  55.                     <a href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}">{{ product.name }}</a>
  56.                 </h3>
  57.                 <div class="articleBit-desc  pt-1">
  58.                     Ref: {{ product.code }}
  59.                 </div>
  60.                 {% if  sylius_inventory_is_available(variant) %}
  61.                     {% set stock_product = variant.OnHand - variant.OnHold %}
  62.                     <div class="color-primary-s pt-1 text-lowercase font-14">
  63.                         {{stock_product}} {{'app.product.in_stock'|trans}}
  64.                     
  65.                     </div>
  66.                 {% else %}
  67.                     {% if not app.user %}
  68.                         <div class="text-danger pt-1 ">{{ 'app.product.out_of_stock' | trans }}</div>
  69.                     {% endif %}
  70.                 {% endif %}
  71.             </div>
  72.             <div class="row no-gutters align-items-center pt-2 flex-md-nowrap">
  73.                 <div class="articleBit-price col  mb-md-0 d-block">
  74.                     {% if app.user%}
  75.                         {% if not product.variants.empty() %}
  76.                             <div class="price-old" data-js-product-original-price   {{ sylius_test_html_attribute('product-price', money.calculatePrice(product|sylius_resolve_variant)) }}>
  77.                                 {% if channelpricing.discountedPrice and channelpricing.discountedPrice != channelpricing.price and channelpricing|app_check_promotion_price %}
  78.                                     {{ money.convertAndFormat(channelpricing.price )}}  <small>{{'app.ui.incl_tax'|trans}}</small>
  79.                                 {% endif %}
  80.                             </div>
  81.                             <strong class="price-promo"  {{ sylius_test_html_attribute('product-price') }}> {{ money.calculatePrice(product|sylius_resolve_variant) }} <small>{{'app.ui.incl_tax'|trans}}</small></strong>
  82.                             
  83.                         {% endif %}
  84.                     {% endif %}
  85.                 </div>
  86.                 {% if app.user %}
  87.                     <div class="col-lg-auto pt-lg-0 pt-3 col-12">
  88.                         {% if variant is not null %}
  89.                             {% if not sylius_inventory_is_available(variant) %}
  90.                                 <div class="text-danger">{{ 'app.product.out_of_stock' | trans }}</div>
  91.                             {% else %}
  92.                                 {#{% if product.retired == false %}#}
  93.                                     {% include '@SyliusShop/Product/Show/_addToCartBox.html.twig' with {'product': product } %}
  94.                                 {#{% endif %}#}
  95.                             {% endif %}
  96.                         {% endif %}
  97.                     </div>
  98.                 {% endif %}
  99.             </div>
  100.         </div>
  101.     </div>
  102. </article>