custom/plugins/HyBuys/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.             {% block component_product_box_content %}
  10.                 <div class="product_block">
  11.                     {% block component_product_box_badges %}
  12.                         {% sw_include '@Storefront/storefront/component/product/card/badges.html.twig' %}
  13.                     {% endblock %}
  14.                     {% if config('core.cart.wishlistEnabled') %}
  15.                         {% block component_product_box_wishlist_action %}
  16.                             {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  17.                                 appearance: 'circle',
  18.                                 productId: id
  19.                             } %}
  20.                         {% endblock %}
  21.                     {% endif %}
  22.                     {% block component_product_box_rich_snippets %}
  23.                         {# @deprecated tag:v6.5.0 - Block will be removed completely including the template it references #}
  24. {#                        {% sw_include '@Storefront/storefront/component/product/card/meta.html.twig' %}#}
  25.                     {% endblock %}
  26.                     {% block component_product_box_image %}
  27. {#                        <div class="product-image-wrapper">#}
  28.                             {# fallback if display mode is not set #}
  29.                             {% set displayMode = displayMode ?: 'standard' %}
  30.                             {# set display mode 'cover' for box-image with standard display mode #}
  31.                             {% if layout == 'image' and displayMode == 'standard' %}
  32.                                 {% set displayMode = 'cover' %}
  33.                             {% endif %}
  34.                             {% block component_product_box_image_link %}
  35.                                 <a href="{{ seoUrl('frontend.detail.page', { 'productId': id }) }}"
  36.                                    title="{{ name }}"
  37.                                    class="product_image">
  38.                                     {% block component_product_box_image_link_inner %}
  39.                                         {% if cover.url %}
  40.                                             {% set attributes = {
  41.                                                 'class': 'is-'~displayMode,
  42.                                                 'alt': (cover.translated.alt ?: name),
  43.                                                 'title': (cover.translated.title ?: name)
  44.                                             } %}
  45.                                             {% if displayMode == 'cover' or displayMode == 'contain' %}
  46.                                                 {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  47.                                             {% endif %}
  48.                                             {% block component_product_box_image_thumbnail %}
  49.                                                 {% sw_thumbnails 'product-image-thumbnails' with {
  50.                                                     media: cover,
  51.                                                     sizes: sizes
  52.                                                 } %}
  53.                                             {% endblock %}
  54.                                         {% else %}
  55.                                             {% block component_product_box_image_placeholder %}
  56. {#                                                <div class="product-image-placeholder">#}
  57. {#                                                    {% sw_icon 'placeholder' style {#}
  58. {#                                                        'size': 'fluid'#}
  59. {#                                                    } %}#}
  60. {#                                                </div>#}
  61.                                             {% endblock %}
  62.                                         {% endif %}
  63.                                     {% endblock %}
  64.                                 </a>
  65.                             {% endblock %}
  66. {#                        </div>#}
  67.                     {% endblock %}
  68.                     {% block component_product_box_info %}
  69.                         <div class="info_block">
  70.                             {% block component_product_box_rating %}
  71.                                 {% if config('core.listing.showReview') %}
  72. {#                                    <div class="product-rating">#}
  73. {#                                        {% if product.ratingAverage %}#}
  74. {#                                            {% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {#}
  75. {#                                                points: product.ratingAverage,#}
  76. {#                                                style: 'text-primary'#}
  77. {#                                            } %}#}
  78. {#                                        {% endif %}#}
  79. {#                                    </div>#}
  80.                                 {% endif %}
  81.                             {% endblock %}
  82.                             {% block component_product_box_name %}
  83.                                 <a href="/search?search={{ product.manufacturer.name }}" class="product_brand">{{ product.manufacturer.name }}</a>
  84.                                 <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  85.                                    class="product_name"
  86.                                    title="{{ name }}">
  87.                                     {{ name }}
  88.                                 </a>
  89.                             {% endblock %}
  90.                             {% block component_product_box_variant_characteristics %}
  91. {#                                <div class="product-variant-characteristics">#}
  92. {#                                    <div class="product-variant-characteristics-text">#}
  93. {#                                        {% if not displayParent %}#}
  94. {#                                            {% for variation in product.variation %}#}
  95. {#                                                {{ variation.group }}:#}
  96. {#                                                <span class="product-variant-characteristics-option">#}
  97. {#                                                    {{ variation.option }}#}
  98. {#                                                </span>#}
  99. {#                                                {% if product.variation|last != variation %}#}
  100. {#                                                    {{ " | " }}#}
  101. {#                                                {% endif %}#}
  102. {#                                            {% endfor %}#}
  103. {#                                        {% endif %}#}
  104. {#                                    </div>#}
  105. {#                                </div>#}
  106.                             {% endblock %}
  107.                             {% block component_product_box_description %}
  108. {#                                <div class="product-description">#}
  109. {#                                    {{ product.translated.description|striptags|raw }}#}
  110. {#                                </div>#}
  111.                             {% endblock %}
  112.                             {% block component_product_box_price %}
  113.                             <div class="price_block">
  114.                                 {% sw_include '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
  115.                             </div>
  116.                             {% endblock %}
  117.                             {% block component_product_box_action %}
  118.                                 {% sw_include '@Storefront/storefront/component/product/card/action.html.twig' %}
  119.                             {% endblock %}
  120.                         </div>
  121.                     {% endblock %}
  122.                 </div>
  123.             {% endblock %}
  124.     {% endif %}
  125. {% endblock %}