custom/static-plugins/NdTheme/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. {% block component_product_box %}
  3.     {% if product %}
  4.         {% set name = product.translated.name %}
  5.         {% set id = product.id %}
  6.         {% set cover = product.cover.media %}
  7.         {% set variation = product.variation %}
  8.         {% set displayParent = product.variantListingConfig.displayParent and product.parentId === null %}
  9.         {% set productUrl = seoUrl('frontend.detail.page', { 'productId': id }) %}
  10.         <div class="product-box box-{{ layout }} h-full">
  11.             {% block component_product_box_content %}
  12.                 <div class="relative h-full flex flex-col">
  13.                     {% block component_product_box_badges %}
  14.                         {% sw_include '@Storefront/storefront/component/product/card/badges.html.twig' %}
  15.                     {% endblock %}
  16.                     {% block component_product_box_rich_snippets %}
  17.                         {# @deprecated tag:v6.5.0 - Block will be removed completely including the template it references #}
  18.                         {% sw_include '@Storefront/storefront/component/product/card/meta.html.twig' %}
  19.                     {% endblock %}
  20.                     {% block component_product_box_image %}
  21.                         <div class="product-image-wrapper relative">
  22.                             {% block component_product_box_image_link %}
  23.                                 <a href="{{ productUrl }}"
  24.                                    title="{{ name }}"
  25.                                    class="product-image-link is-{{ displayMode }} block ratio ratio_product_image">
  26.                                     {% block component_product_box_image_link_inner %}
  27.                                         {% if cover.url %}
  28.                                             {% set attributes = {
  29.                                                 'class': 'product-image is-'~displayMode,
  30.                                                 'alt': (cover.translated.alt ?: name),
  31.                                                 'title': (cover.translated.title ?: name)
  32.                                             } %}
  33.                                             {% if displayMode == 'cover' or displayMode == 'contain' %}
  34.                                                 {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  35.                                             {% endif %}
  36.                                             {% block component_product_box_image_thumbnail %}
  37.                                                 {% sw_thumbnails 'product-image-thumbnails' with {
  38.                                                     media: cover,
  39.                                                     sizes: sizes
  40.                                                 } %}
  41.                                             {% endblock %}
  42.                                         {% else %}
  43.                                             {% block component_product_box_image_placeholder %}
  44.                                                 {% sw_icon 'placeholder' style {
  45.                                                     'size': 'fluid'
  46.                                                 } %}
  47.                                             {% endblock %}
  48.                                         {% endif %}
  49.                                     {% endblock %}
  50.                                 </a>
  51.                             {% endblock %}
  52.                             {% if config('core.cart.wishlistEnabled') %}
  53.                                 <div class="absolute top-2 right-2">
  54.                                     {% block component_product_box_wishlist_action %}
  55.                                         {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  56.                                             appearance: 'circle',
  57.                                             productId: id
  58.                                         } %}
  59.                                     {% endblock %}
  60.                                 </div>
  61.                             {% endif %}
  62.                         </div>
  63.                     {% endblock %}
  64.                     {% block component_product_box_info %}
  65.                         <div class="product-info flex flex-col h-full p-2">
  66.                             {% block component_product_box_rating %}
  67.                                 {% if config('core.listing.showReview') %}
  68.                                     <div class="product-rating lg:col-span-full">
  69.                                         {% if product.ratingAverage %}
  70.                                             {% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
  71.                                                 points: product.ratingAverage,
  72.                                                 style: 'text-primary'
  73.                                             } %}
  74.                                         {% endif %}
  75.                                     </div>
  76.                                 {% endif %}
  77.                             {% endblock %}
  78.                             {% if product.manufacturer.translated.name %}
  79.                                 {% block component_product_box_brand_name %}
  80.                                     <div class="product-brand-name font-accent font-medium text-xs mb-2">
  81.                                         {{ product.manufacturer.translated.name }}
  82.                                     </div>
  83.                                 {% endblock %}
  84.                             {% endif %}
  85.                             {% block component_product_box_name %}
  86.                                 <a href="{{ productUrl }}"
  87.                                    class="product-name block text-xs font-bold lg:text-sm"
  88.                                    title="{{ name }}">
  89.                                     {{ name }}
  90.                                 </a>
  91.                             {% endblock %}
  92.                             {% block component_product_box_variant_characteristics %}
  93.                                 {% if product.variation %}
  94.                                     <div class="product-variant-characteristics text-xs mt-1 lg:col-span-full">
  95.                                         <div class="product-variant-characteristics-text">
  96.                                             {% if not displayParent %}
  97.                                                 {% for variation in product.variation %}
  98.                                                     {{ variation.group }}:
  99.                                                     <span class="product-variant-characteristics-option">
  100.                                                 {{ variation.option }}
  101.                                             </span>
  102.                                                     {% if product.variation|last != variation %}
  103.                                                         {{ " | " }}
  104.                                                     {% endif %}
  105.                                                 {% endfor %}
  106.                                             {% endif %}
  107.                                         </div>
  108.                                     </div>
  109.                                 {% endif %}
  110.                             {% endblock %}
  111.                             {% block component_product_box_price %}
  112.                                 <div class="product-price-info pt-1 mt-auto lg:row-start-2 lg:col-end-3 lg:pt-0 lg:mt-0">
  113.                                     {% sw_include '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
  114.                                 </div>
  115.                             {% endblock %}
  116.                         </div>
  117.                     {% endblock %}
  118.                 </div>
  119.             {% endblock %}
  120.         </div>
  121.     {% endif %}
  122. {% endblock %}