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

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/box-standard.html.twig' %}
  2. {# like minimal adjusted box for starting page product slider but few adjustments #}
  3. {# add clerk tracking if search page and if clerk plugin is enabled #}
  4. {% block component_product_box %}
  5.     {% if product %}
  6.         {% set name = product.translated.name %}
  7.         {% set id = product.id %}
  8.         {% set cover = product.cover.media %}
  9.         {% set variation = product.variation %}
  10.         <div class="card product-box box-{{ layout }}"{% if config('Clerkio.config.enabled') and isSearchPage %} data-clerk-product-id="{{product.id|upper}}"{% endif %}>
  11.             {% block component_product_box_content %}
  12.                 {{ parent() }}
  13.             {% endblock %}
  14.         </div>
  15.     {% endif %}
  16. {% endblock %}
  17. {% block component_product_box_image %}
  18.     {% set shortDescription = product.translated.customFields.grimm_customFields_short_desc %}
  19.     {% if product.mkxBVParent %}
  20.         {% set name = product.mkxBVParent.translated.name %}
  21.         {% set shortDescription = product.mkxBVParent.translated.customFields.grimm_customFields_short_desc %}
  22.         {% set cover = product.mkxBVParent.cover.media %}
  23.     {% endif %}
  24.     <div class="product-image-wrapper">
  25.         {# fallback if display mode is not set #}
  26.         {% set displayMode = displayMode ?: 'standard' %}
  27.         {# set display mode 'cover' for box-image with standard display mode #}
  28.         {% if layout == 'image' and displayMode == 'standard' %}
  29.             {% set displayMode = 'cover' %}
  30.         {% endif %}
  31.         <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  32.             title="{{ name }}"
  33.             class="product-image-link is-{{ displayMode }}">
  34.             {% if cover.url %}
  35.                 {% set attributes = {
  36.                     'class': 'product-image is-'~displayMode,
  37.                     'alt': (cover.translated.alt ?: name),
  38.                     'title': (cover.translated.title ?: name)
  39.                 } %}
  40.                 {% if displayMode == 'cover' or displayMode == 'contain' %}
  41.                     {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  42.                 {% endif %}
  43.                 {% sw_thumbnails 'product-image-thumbnails' with {
  44.                     media: cover,
  45.                     sizes: {
  46.                         'xs': '501px',
  47.                         'sm': '315px',
  48.                         'md': '427px',
  49.                         'lg': '333px',
  50.                         'xl': '284px'
  51.                     }
  52.                 } %}
  53.             {% else %}
  54.                 <div class="product-image-placeholder">
  55.                     {% sw_icon 'placeholder' style {
  56.                         'size': 'fluid'
  57.                     } %}
  58.                 </div>
  59.             {% endif %}
  60.         </a>
  61.         {% if config('core.cart.wishlistEnabled') %}
  62.             {% block component_product_box_wishlist_action %}
  63.             {% endblock %}
  64.         {% endif %}
  65.     </div>
  66.         <div class="product-name-number__container">
  67.             <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  68.                 class="product-name"
  69.                 title="{{ name }}">
  70.                 {{ name }}
  71.             </a>
  72.             {# not shown on starting page slider product box #}
  73.             {% if product.translated.customFields.grimm_customFields_short_desc and activeRoute != "frontend.home.page" and activeRoute != "frontend.detail.page" %}
  74.                 <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  75.                     class="product-info__gallery-description">
  76.                     {{ shortDescription }}
  77.                     {% sw_include '@Storefront/storefront/component/product/price-unit-info.html.twig' with { 'product': product } %}
  78.                 </a>
  79.             {% endif %}
  80.         </div>
  81. {% endblock %}
  82. {% block component_product_box_info %}
  83.     <div class="product-info">
  84.         {% block component_product_box_rating %}{% endblock %}
  85.         {% block component_product_box_name %}{% endblock %}
  86.         {% block component_product_box_variant_characteristics %}{% endblock %}
  87.         {% block component_product_box_description %}{% endblock %}
  88.         {% block component_product_additional_info %}
  89.             <div class="product_additional_info">
  90.                 <div class="d-flex align-items-end">
  91.                     {% sw_include '@Storefront/storefront/component/product/card/price-uvp.html.twig' %}
  92.                     {% sw_include '@Storefront/storefront/component/product/card/price-discount-amount.html.twig' %}
  93.                 </div>
  94.             </div>
  95.         {% endblock %}
  96.         {% block component_product_box_price %}
  97.             <div class="price-container">
  98.                  {# SD:4986 #}
  99.                 {% set requestOnly = product.translated.customFields.grimm_customfields_productRequest_only %}
  100.                 {% if requestOnly %}
  101.                     {% set showUVP = product.translated.customFields.grimm_customfields_productRequest_showUVP %}
  102.                     {% if showUVP %}
  103.                         {% sw_include '@Storefront/solution360/grimm/product/request-only-uvp-display.html.twig' with {productListing: true} %}
  104.                     {% else %}
  105.                         <span class="product-price mt-0" style="height: 28px">{{ "product.price.priceUponRequest"|trans|sw_sanitize }}</span>
  106.                     {% endif %}
  107.                 {% else %}
  108.                     {{ parent() }}
  109.                     {# {% block component_product_box_action %}{% endblock %} #}
  110.                     {% sw_include '@Storefront/storefront/component/product/card/action.html.twig' %}
  111.                 {% endif %}
  112.             </div>
  113.         {% endblock %}
  114.         {# include changed button because buy action only on list view #}
  115.         
  116.         {# this template will also include the merkliste heart if plugin activated #}
  117.         {# {% sw_include '@Storefront/storefront/component/product/card/action.html.twig' %} #}
  118.     </div>
  119. {% endblock %}