custom/plugins/sw-asus/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 MoorlProductPromoActive = getPluginStateByName('MoorlProductPromo', context.context) %}
  9.         <div class="card product-box box-{{ layout }} {% if MoorlProductPromoActive and config('MoorlProductPromo.config.inListing') and product.extensions.MoorlProductPromo %} promo-image-class {% endif %}">
  10.             {% block component_product_box_content %}
  11.             <div class="card-body">
  12.                 {% block component_product_box_badges %}
  13.                     {% sw_include '@Storefront/storefront/component/product/card/badges.html.twig' %}
  14.                 {% endblock %}
  15.                 {% block component_product_box_rich_snippets %}
  16.                     {% sw_include '@Storefront/storefront/component/product/card/meta.html.twig' %}
  17.                 {% endblock %}
  18.                 {% block component_product_box_image %}
  19.                 
  20.                     {% if not sizes is defined %}
  21.                         {% set sizes = {
  22.                             'default' : '200px'
  23.                         } %}
  24.                     {% endif %}
  25.                     <div class="product-image-wrapper">
  26.                         {# fallback if display mode is not set #}
  27.                         {% set displayMode = displayMode ?: 'standard' %}
  28.                         {# set display mode 'cover' for box-image with standard display mode #}
  29.                         {% if layout == 'image' and displayMode == 'standard' %}
  30.                             {% set displayMode = 'cover' %}
  31.                         {% endif %}
  32.                         <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  33.                            title="{{ name }}"
  34.                            class="product-image-link is-{{ displayMode }}">
  35.                             {% if cover.url %}
  36.                                 {% set attributes = {
  37.                                     'class': 'product-image is-'~displayMode,
  38.                                     'alt': (cover.translated.alt ?: name),
  39.                                     'title': (cover.translated.title ?: name)
  40.                                 } %}
  41.                                 {% if displayMode == 'cover' or displayMode == 'contain' %}
  42.                                     {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  43.                                 {% endif %}
  44.                                 {% if load == 'lazy' %}
  45.                                     {% set attributes = attributes|merge({ 'loading': 'lazy' }) %}
  46.                                 {% endif %}
  47.                                 {% sw_thumbnails 'product-image-thumbnails' with {
  48.                                     media: cover,
  49.                                     sizes: sizes,
  50.                                     load: load
  51.                                 } %}
  52.                             {% else %}
  53.                                 <div class="product-image-placeholder">
  54.                                     {% sw_icon 'placeholder' style {
  55.                                         'size': 'fluid'
  56.                                     } %}
  57.                                 </div>
  58.                             {% endif %}
  59.                         </a>
  60.                         {% if shopware.config.core.cart.wishlistEnabled %}
  61.                             {% block component_product_box_wishlist_action %}
  62.                                 {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  63.                                     appearance: 'circle',
  64.                                     productId: id
  65.                                 } %}
  66.                             {% endblock %}
  67.                         {% endif %}
  68.                     </div>
  69.                 {% endblock %}
  70.                 {% block component_product_box_info %}
  71.                     <div class="product-info">
  72.                         <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  73.                            class="product-name"
  74.                            title="{{ name }}">
  75.                             {{ name }}
  76.                         </a>
  77.                         {% if product.translated.customFields.asus_product_marketing_name_1|trim != "" %}
  78.                             <div class="product-detail-name-subhead category-detail-subhead">{{ product.translated.customFields.asus_product_marketing_name_1|raw }}</div>
  79.                         {% endif %}
  80.                         {% block component_product_box_rating %}
  81.                             {{ parent() }}
  82.                             {% if page.header.activeLanguage.translationCode.code == "de-DE" or app.request.locale == "de-DE" %}
  83.                                 <!-- TrustBox widget - Product Mini -->
  84.                                 <div class="trustpilot-widget" data-locale="de-DE" data-template-id="54d39695764ea907c0f34825"
  85.                                      data-businessunit-id="5dea2794a525f00001f5bc2e" data-style-height="24px" data-style-width="100%"
  86.                                      data-theme="light" data-sku="{{ product.translated.customFields.onedot_asus_product_plenty_variation_id }}" data-star-color="#f8b704" data-text-color="#808080">
  87.                                     <a href="https://de.trustpilot.com/review/webshop.asus.com" target="_blank"
  88.                                        rel="noopener">Trustpilot</a>
  89.                                 </div>
  90.                                 <!-- End TrustBox widget -->
  91.                             {% endif %}
  92.                         {% endblock %}
  93.                         {% block component_product_box_price %}
  94.                             {% sw_include '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
  95.                         {% endblock %}
  96.                         {% if MoorlProductPromoActive %}
  97.                             {% if config('MoorlProductPromo.config.inListing') and product.extensions.MoorlProductPromo %}
  98.                                 {% sw_include '@Storefront/plugin/moorl-product-promo/summary-box.html.twig' with {
  99.                                     productPromo: product.extensions.MoorlProductPromo
  100.                                 } %}
  101.                             {% endif %}
  102.                         {% endif %}
  103.                         {% block component_product_box_variant_characteristics %}
  104.                             <div class="product-variant-characteristics">
  105.                                 {% if product.parentId is not same as(null) %}
  106.                                     {% sw_include '@Storefront/storefront/component/product/card/listing-configurator.html.twig' ignore missing %}
  107.                                 {% endif %}
  108.                             </div>
  109.                         {% endblock %}
  110.                         {% block component_product_box_description %}
  111.                             {% if product.translated.customFields.onedot_asus_product_highlight %}
  112.                                 <div class="product-highlight">
  113.                                     {# {{ product.translated.customFields.onedot_asus_product_highlight|raw }} #}
  114.                                 </div>
  115.                             {% endif %}
  116.                         {% endblock %}
  117.                         {% if page.header.activeLanguage.translationCode.code == "de-DE"  or app.request.locale == "de-DE" %}
  118.                             {% block component_product_box_usp %}
  119.                                 {% if product.translated.customFields.plentymarkets_bulletpoints|raw and product.translated.customFields.plentymarkets_bulletpoints|raw != '&nbsp;' and product.translated.customFields.plentymarkets_bulletpoints|raw != ' ' %}
  120.                                     <div class="product-highlight">
  121.                                         {# {{ product.translated.customFields.plentymarkets_bulletpoints|raw }} #}
  122.                                     </div>
  123.                                 {% endif %}
  124.                             {% endblock %}
  125.                         {% endif %}
  126.                         {% block component_product_box_action %}
  127.                          {% set isAvailable = product.availableStock > 0 %}
  128.                             {% set displayFrom = product.calculatedPrices.count > 1 %}
  129.                             {% set displayBuyButton = isAvailable %}
  130.                             <div class="d-flex">
  131.                                 <div class="text-nowrap product-availability-text" style={% if displayBuyButton and config('core.listing.allowBuyInListing') %} "color: #018a01;" {% else %} "color: #8a6100;" {% endif %} >
  132.                                 {% if displayBuyButton and config('core.listing.allowBuyInListing') %}
  133.                                     {{ "listing.boxProductInStock"|trans|sw_sanitize }}
  134.                                 {% else %}
  135.                                     {{ "listing.boxProductNotInStock"|trans|sw_sanitize }}
  136.                                 {% endif %}
  137.                                 </div>
  138.                                 <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  139.                                     class="btn btn-block btn-link"
  140.                                     title="{{ "listing.boxProductDetails"|trans|striptags }}">
  141.                                     {{ "listing.boxProductDetails"|trans|sw_sanitize }}
  142.                                     {% sw_icon 'atoms-arrow-medium-right' style {'pack':'default', 'size': 'xs'} %}
  143.                                 </a>
  144.                             </div>
  145.                             {{ parent() }}
  146.                         {% endblock %}
  147.                     </div>
  148.                 {% endblock %}
  149.                     </div>
  150.             {% endblock %}
  151.         </div>
  152.     {% endif %}
  153. {% endblock %}