vendor/dvdw/directory/src/Resources/views/storefront/component/shops/webshop.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.     {% set sizes = {
  4.         'xs': '500px',
  5.         'sm': '315px',
  6.         'md': '390px',
  7.         'lg': '350px',
  8.         'xl': '280px'
  9.     } %}
  10.     {{ parent() }}
  11. {% endblock %}
  12. {% block component_product_box_content %}
  13.     {# SET TYPE FREE OR GOLD #}
  14.     {% set type = 'free' %}
  15.     {% if product.extensions.dvdwParticipations and product.extensions.dvdwParticipations.elements | length > 0 %}
  16.         {% set participation = product.extensions.dvdwParticipations | first %}
  17.         {% if participation and participation.orderLineItem and participation.orderLineItem.extensions.dvdwTicket %}
  18.             {% set type = participation.orderLineItem.extensions.dvdwTicket.type %}
  19.         {% endif %}
  20.     {% endif %}
  21.     {% if product.tagIds is defined and ('f78e8311466f4d31aa91e6b39e489b81' in product.tagIds) %}
  22.         {% set type = 'gold' %}
  23.     {% endif %}
  24.     {# SET PROMO PHASE #}
  25.     {# {% set showPromoPhase = context.extensions.currentDvdwEvent.phase === 'phase-promo-show'   %} #}
  26.     {% set usePromoPhase = context.extensions.currentDvdwEvent.phase === 'phase-promo-use'   %}
  27.     {# {% set showPromoPhase = context.extensions.currentDvdwEvent.phase === 'phase-promo-show'   %} #}
  28.     {# {% set usePromoPhase = true   %} #}
  29.     {# TARGET URL #}
  30.     {% set targetUrl = seoUrl('frontend.detail.page', {'productId': id}) %}
  31.         {% if usePromoPhase == true && participation && participation.dvdwPromotion && participation.dvdwPromotion && participation.dvdwPromotion.promoUrl %}
  32.     {% set targetUrl = participation.dvdwPromotion.promoUrl %}
  33.     {% endif %}
  34.     {# MEDIA URL #}
  35.     {% set usedMedia = cover %}
  36.         {% if usePromoPhase == true and participation and participation.dvdwPromotion and participation.dvdwPromotion.media %}
  37.     {% set usedMedia = participation.dvdwPromotion.media %}
  38.     {% endif %}
  39.         <div
  40.         class="card-body {% if type === 'gold' %}gold-webshop{% endif %}"> {# GOLDEN WEBSHOP BADGE #}
  41.         {% block component_product_box_badges %}
  42.             {{ parent() }}
  43.             {% if type === 'gold' %}
  44.                 <div class="badge badge-gold">
  45.                     <img src="/bundles/dvdwdirectory/images/product/badge-gold.svg" alt="golden badge"/>
  46.                 </div>
  47.             {% endif %}
  48.         {% endblock %}
  49.         {% block component_product_box_rich_snippets %}
  50.             {{ parent() }}
  51.         {% endblock %}
  52.         {% block component_product_box_image %}
  53.             {# WEBSHOP NAME #}
  54.             {% if participation && participation.dvdwPromotion && usePromoPhase == true %}
  55.                 {% block component_product_box_name_top %}
  56.                     <a href="{{ targetUrl }}" class="product-name" title="{{ name }}" target="_blank" rel="noopener noreferrer">
  57.                         {{ name }}
  58.                     </a>
  59.                 {% endblock %}
  60.             {% endif %}
  61.             <div
  62.                 class="product-image-wrapper">
  63.                 {# fallback if display mode is not set #}
  64.                 {% set displayMode = displayMode ?: 'standard' %}
  65.                 {# set display mode 'cover' for box-image with standard display mode #}
  66.                 {% if layout == 'image' and displayMode == 'standard' %}
  67.                     {% set displayMode = 'cover' %}
  68.                 {% endif %}
  69.                 <a href="{{ targetUrl }}" title="{{ name }}" class="product-image-link is-{{ displayMode }}" target="_blank" rel="noopener noreferrer">
  70.                     {% if usedMedia.url %}
  71.                         {% set attributes = {
  72.                             'class': 'product-image is-'~displayMode,
  73.                             'alt': (usedMedia.translated.alt ?: name),
  74.                             'title': (usedMedia.translated.title ?: name)
  75.                         } %}
  76.                         {% if displayMode == 'cover' or displayMode == 'contain' %}
  77.                             {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  78.                         {% endif %}
  79.                         {% sw_thumbnails 'product-image-thumbnails' with {
  80.                             media: usedMedia,
  81.                             sizes: sizes
  82.                         } %}
  83.                     {% else %}
  84.                         <div class="product-image-placeholder">
  85.                             {% sw_icon 'placeholder-icon' style {
  86.                                 pack: 'custom-icons',
  87.                                 size: 'fluid'
  88.                             } %}
  89.                         </div>
  90.                     {% endif %}
  91.                 </a>
  92.                 {% if config('core.cart.wishlistEnabled') %}
  93.                     {% block component_product_box_wishlist_action %}
  94.                         {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  95.                             appearance: 'circle',
  96.                             productId: id
  97.                         } %}
  98.                     {% endblock %}
  99.                 {% endif %}
  100.             </div>
  101.         {% endblock %}
  102.         {% block component_product_box_info %}
  103.             {# <hr class="image-info-line"> #}
  104.             <div class="product-info">
  105.                 {% block component_product_box_rating %}{% endblock %}
  106.                 {% block component_product_box_name %}
  107.                     <div>
  108.                         {% if participation and participation.dvdwPromotion and usePromoPhase == true %}
  109.                             <a href="{{ targetUrl }}" class="product-name promo" title="{{ participation.dvdwPromotion.translated.title }}" target="_blank" rel="noopener noreferrer">
  110.                                 {{ participation.dvdwPromotion.translated.title }}
  111.                             </a>
  112.                             {% if participation.dvdwPromotion.freeShipping == true %}
  113.                                 <div class="free-shipping">
  114.                                     <span>
  115.                                         {{ "listingItem.freeShipping"|trans|sw_sanitize }}
  116.                                     </span>
  117.                                     {% if participation.dvdwPromotion.freeShippingMinimumAmount != null and participation.dvdwPromotion.freeShippingMinimumAmount > 0 %}
  118.                                         <span>
  119.                                             {{ "listingItem.freeShippingFrom"|trans|replace({'{price}': participation.dvdwPromotion.freeShippingMinimumAmount|number_format(2, ',', '.')})|sw_sanitize }}
  120.                                         </span>
  121.                                     {% endif %}
  122.                                 </div>
  123.                             {% else %}
  124.                                 <div class="free-shipping"></div>
  125.                             {% endif %}
  126.                         {% else %}
  127.                             <a href="{{ targetUrl }}" class="product-name" title="{{ name }}">
  128.                                 {{ name }}
  129.                             </a>
  130.                         {% endif %}
  131.                     </div>
  132.                 {% endblock %}
  133.                 {% block component_product_box_promocode %}
  134.                     {% if usePromoPhase == true %}
  135.                         <div
  136.                             class="promocode-wrapper">
  137.                             {# PROMO CODE #}
  138.                             {% if participation && participation.dvdwPromotion && participation.dvdwPromotion.promoCode && usePromoPhase == true  %}
  139.                                 <div class="promocode-label">Promo code</div>
  140.                                 <div class="promocode {% if type === 'gold' %}gold-webshop{% endif %}">
  141.                                     {{ participation.dvdwPromotion.promoCode }}
  142.                                 </div>
  143.                             {% endif %}
  144.                         </div>
  145.                     {% endif %}
  146.                 {% endblock %}
  147.                 {% block component_product_box_variant_characteristics %}{% endblock %}
  148.                 {% block component_product_box_description %}
  149.                     <div class="product-description {% if product.translated.description|length > 75 %} tooltip-target {% endif %}">
  150.                         {% if participation && participation.dvdwPromotion && usePromoPhase == true && participation.dvdwPromotion.translated.description %}
  151.                             {{ participation.dvdwPromotion.translated.description }}
  152.                         {% else %}
  153.                             {{ product.translated.description|striptags|raw }}
  154.                         {#                        {% if product.translated.description|length > 75 %}#}
  155.                             {#                            <span class="tooltip-text">#}
  156.                             {#                            {{ product.translated.description|striptags|raw }}#}
  157.                             {#                            </span>#}
  158.                             {#                        {% endif %}#}
  159.                         {% endif %}
  160.                     </div>
  161.                 {% endblock %}
  162.                 {% block component_product_box_price %}{% endblock %}
  163.                 {% block component_product_box_action %}
  164.                     {% sw_include '@DvdwDirectory/storefront/component/shops/card-actions.html.twig' %}
  165.                 {% endblock %}
  166.             </div>
  167.         {% endblock %}
  168.     </div>
  169. {% endblock %}