custom/plugins/AmMacTrade/src/Resources/views/storefront/component/product/card/box-standard.html.twig line 1

Open in your IDE?
  1. {% block component_product_box %}
  2.     {% if product %}
  3.         {% set name = product.translated.name %}
  4.         {% set id = product.id %}
  5.         {% set cover = product.cover.media %}
  6.         {% set variation = product.variation %}
  7.         {% set discount = product.calculatedPrice.listPrice.discount %}
  8.         <div class="card product-box box-{{ layout }} {% if product.customFields.product_custom_fields_subscription == true %} has-subscription {% endif %}">
  9.             {% block component_product_box_content %}
  10.                 <div class="card-body" data-delivery-id="{{ product.deliveryTimeId }}" data-product-type="{{ product.customFields.product_custom_fields_subscription_productType }}">
  11.                     {#{% if product.customFields.product_custom_fields_subscription == true and product.restockTime <= 10 %}#}
  12.                     {% if product.customFields.product_custom_fields_subscription == true and product.customFields.product_custom_fields_subscription_productType != 'ACCESSORY' and product.customFields.product_custom_fields_subscription_monthlyPriceGross > 0 %}
  13.                         <div class="abo-badge {% if product.customFields.product_custom_fields_batch_protect == true %} second-level {% endif %}">
  14.                             <img src="{{ asset('assets/images/badge_abo.svg', "@AmMacTrade") }}" alt="Abo" height="50" width="50">
  15.                         </div>
  16.                     {% endif %}
  17.                     {% if product.customFields.product_custom_fields_batch_protect == true %}
  18.                         <div class="protect-badge">
  19.                             {{ "component.promotion.protect-badge"|trans|raw }}
  20.                         </div>
  21.                     {% endif %}
  22.                     {% if discount and context.salesChannel.id !='45be9f42765d42e8ae1137d1812040f4' and context.salesChannel.id !='4faca3b6a7f149cea7ade06ee340ce19' %}
  23.                         <div class="discount">
  24.                             {{ discount|currency }}
  25.                         </div>
  26.                     {% endif %}
  27.                     {% if context.salesChannel.id =='45be9f42765d42e8ae1137d1812040f4' or context.salesChannel.id =='4faca3b6a7f149cea7ade06ee340ce19' %}
  28.                         
  29.             {% if product.calculatedPrices.count > 0 %}
  30.             <div class="discount">
  31. {% set realm = product.calculatedPrices.last %}
  32.             {{ realm.listPrice.discount|currency }}
  33.         </div>
  34.         {% endif %}
  35.         
  36.                     {% endif %}
  37.                     {% block component_product_box_badges %}
  38.                         {% sw_include '@Storefront/storefront/component/product/card/badges.html.twig' %}
  39.                     {% endblock %}
  40.                     {% block component_product_box_rich_snippets %}
  41.                         {% sw_include '@Storefront/storefront/component/product/card/meta.html.twig' %}
  42.                     {% endblock %}
  43.                     {% block component_product_box_image %}
  44.                         <div class="product-image-wrapper">
  45.                             {# fallback if display mode is not set #}
  46.                             {% set displayMode = displayMode ?: 'standard' %}
  47.                             {# set display mode 'cover' for box-image with standard display mode #}
  48.                             {% if layout == 'image' and displayMode == 'standard' %}
  49.                                 {% set displayMode = 'cover' %}
  50.                             {% endif %}
  51.                             <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  52.                                title="{{ name }}"
  53.                                class="product-image-link is-{{ displayMode }}">
  54.                                 {% if cover.url %}
  55.                                     {% set attributes = {
  56.                                         'class': 'product-image is-'~displayMode,
  57.                                         'alt': (cover.translated.alt ?: name),
  58.                                         'title': (cover.translated.title ?: name)
  59.                                     } %}
  60.                                     {% if displayMode == 'cover' or displayMode == 'contain' %}
  61.                                         {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  62.                                     {% endif %}
  63.                                     {% sw_thumbnails 'product-image-thumbnails' with {
  64.                                         media: cover,
  65.                                         sizes: {
  66.                                             'xs': '501px',
  67.                                             'sm': '315px',
  68.                                             'md': '427px',
  69.                                             'lg': '333px',
  70.                                             'xl': '284px'
  71.                                         }
  72.                                     } %}
  73.                                 {% else %}
  74.                                     <div class="product-image-placeholder">
  75.                                         {% sw_icon 'placeholder' style {
  76.                                             'size': 'fluid'
  77.                                         } %}
  78.                                     </div>
  79.                                 {% endif %}
  80.                             </a>
  81.                             {% if config('core.cart.wishlistEnabled') %}
  82.                                 {% block component_product_box_wishlist_action %}
  83.                                     {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  84.                                         appearance: 'circle',
  85.                                         productId: id
  86.                                     } %}
  87.                                 {% endblock %}
  88.                             {% endif %}
  89.                         </div>
  90.                     {% endblock %}
  91.                     {% block component_product_box_info %}
  92.                         <div class="product-info">
  93.                             {% block component_product_box_rating %}
  94.                                 {% if config('core.listing.showReview') %}
  95.                                     <div class="product-rating">
  96.                                         {% if product.ratingAverage %}
  97.                                             {% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
  98.                                                 points: product.ratingAverage,
  99.                                                 style: 'text-primary'
  100.                                             } %}
  101.                                         {% endif %}
  102.                                     </div>
  103.                                 {% endif %}
  104.                             {% endblock %}
  105.                             {% block component_product_box_name %}
  106.                                 <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  107.                                    class="product-name"
  108.                                    title="{{ name }}">
  109.                                     {{ name }}
  110.                                 </a>
  111.                             {% endblock %}
  112.                             {% block component_product_box_variant_characteristics %}
  113.                                 <div class="product-variant-characteristics">
  114.                                     <div class="product-variant-characteristics-text">
  115.                                         {% for variation in product.variation %}
  116.                                             {{ variation.group }}:
  117.                                             <span class="product-variant-characteristics-option">
  118.                                                 {{ variation.option }}
  119.                                             </span>
  120.                                             {% if product.variation|last != variation %}
  121.                                                 {{ " | " }}
  122.                                             {% endif %}
  123.                                         {% endfor %}
  124.                                     </div>
  125.                                 </div>
  126.                             {% endblock %}
  127.                             {% block component_product_box_description %}
  128.                                 <div class="product-description">
  129.                                     {{ product.translated.description|striptags|raw }}
  130.                                 </div>
  131.                             {% endblock %}
  132.                             {% block component_product_box_price %}
  133.                                 {% sw_include '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
  134.                             {% endblock %}
  135.                             {% block component_product_box_action %}
  136.                                 {% sw_include '@Storefront/storefront/component/product/card/action.html.twig' %}
  137.                             {% endblock %}
  138.                         </div>
  139.                     {% endblock %}
  140.                 </div>
  141.             {% endblock %}
  142.         </div>
  143.     {% endif %}
  144. {% endblock %}