custom/plugins/BjerregaardTheme/src/Resources/views/storefront/page/product-detail/index.html.twig line 129

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/index.html.twig' %}
  2. {% block base_head %}
  3.     {% sw_include '@Storefront/storefront/page/product-detail/meta.html.twig' %}
  4. {% endblock %}
  5. {% block base_content %}
  6.     {% block page_product_detail %}
  7.         <div class="product-detail"
  8.         itemscope
  9.         itemtype="https://schema.org/Product">
  10.         <div class="container">
  11.         {% block page_product_detail_inner %}
  12.             {% block page_product_detail_headline %}
  13.                 <div class="product-detail-headline row">
  14.                     {% sw_include '@Storefront/storefront/page/product-detail/headline.html.twig' %}
  15.                     {% set mediaURL = page.product.manufacturer.media.url %}
  16.                     {% if mediaURL %}
  17.                         <div class="product-detail-brand-image col-5 col-sm-3">
  18.                             <img src="{{ mediaURL }}" alt="brand image">
  19.                         </div>
  20.                     {% endif %}
  21.                 </div>
  22.             {% endblock %}
  23.             {% block page_product_detail_content %}
  24.                 <div class="product-detail-content">
  25.                 {% set mediaItems = page.product.media.media %}
  26.                 {% block page_product_detail_main %}
  27.                     <div class="row product-detail-main">
  28.                     {% block page_product_detail_media %}
  29.                         <div class="col-lg-8 product-detail-media">
  30.                             {% if page.product.media %}
  31.                                 <div class="desktop-gallery">
  32.                                     {% sw_include '@Storefront/storefront/page/product-detail/image-gallery.html.twig' with {
  33.                                         'mediaItems': mediaItems,
  34.                                         'isProduct': true,
  35.                                         'fallbackImageTitle': page.product.translated.name,
  36.                                     } %}
  37.                                 </div>
  38.                                 <div class="mobile-gallery">
  39.                                     {% sw_include '@Storefront/storefront/element/cms-element-image-gallery.html.twig' with {
  40.                                         'mediaItems': mediaItems,
  41.                                         'zoomModal': true,
  42.                                         'isProduct': true,
  43.                                         'isGridLayout': true,
  44.                                         'fallbackImageTitle': page.product.translated.name,
  45.                                     } %}
  46.                                 </div>
  47.                             {% endif %}
  48.                         </div>
  49.                     {% endblock %}
  50.                     {% block page_product_detail_buy %}
  51.                         <div class="col-lg-4 product-detail-buy">
  52.                         <div class="product-detail-content">
  53.                             {% block page_product_detail_description %}
  54.                                 {% if "Godkendelse" in page.product.customFields|keys %}
  55.                                     <p class="product-detail-approval ">{{ "product.detail.approvalLabel"|trans|sw_sanitize }}
  56.                                         <span class="product-variant-characteristics-option text-black-50">
  57.                                             {{ page.product.customFields["Godkendelse"] }}
  58.                                         </span>
  59.                                     </p>
  60.                                 {% endif %}
  61.                                 {% sw_include '@Storefront/storefront/page/product-detail/description.html.twig' %}
  62.                             {% endblock %}
  63.                             <div class="product-buy-widget-wrapper">
  64.                                 {% if context.customer  %}
  65.                                     {# condition to show the netPrice label only if the product is not on sale #}
  66.                                     {% if page.product.calculatedPrice.listPrice is null  %}
  67.                                         <p class="product-netPrice-badge product-netPrice-badge--detail">{{ "product.detail.netPriceLabel"|trans|striptags }}</p>
  68.                                     {% endif %}
  69.                                 {% endif %}
  70.                                 {% sw_include '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
  71.                             </div>
  72.                             <div class="product-detail-features">
  73.                                 {% sw_include '@bjerregaard-theme/storefront/page/product-detail/properties.html.twig' %}
  74.                             </div>
  75.                             <div class="product-detail-property-wrapper row">
  76.                                 <p class="col-12 text-black font-weight-bold">{{ "product.detail.propertiesLabel"|trans|sw_sanitize }}</p>
  77.                                 {% set properties = page.product.sortedProperties %}
  78.                                 {% for property in properties %}
  79.                                     {% if property.translated.name|e == "Egenskaber" %}
  80.                                         {% for option in property.options %}
  81.                                             <div class="product-detail-property col-6">
  82.                                                 {% sw_icon "checkmark-circle" %}
  83.                                                 <span>{{ option.translated.name|e }}</span>
  84.                                             </div>
  85.                                         {% endfor %}
  86.                                     {% endif %}
  87.                                 {% endfor %}
  88.                             </div>
  89.                             {% set productDatasheet = page.product.customFields.datasheet %}
  90.                             {% set productDatasheetENG = page.product.customFields.datasheeten %}
  91.                             {% set mediaCollection = searchMedia([productDatasheet, productDatasheetENG], context.context) %}
  92.                             <div class="product-detail-datasheet-wrapper">
  93.                             {% if productDatasheet %}
  94.                             <div class="product-detail-datasheet-container">
  95.                                 <a href="{{ mediaCollection.get(productDatasheet).url }}" target="_blank" class="product-detail-datasheet-link">
  96.                                     <p class="product-detail-datasheet__text"><span class="product-detail-datasheet__label">{{ "product.detail.datasheetLabel"|trans }}</span>{% sw_icon 'arrow-down' %}</p>
  97.                                 </a>
  98.                             </div>
  99.                             {% endif %}
  100.                             {% if productDatasheetENG %}
  101.                                 <div class="product-detail-datasheet-container">
  102.                                     <a href="{{ mediaCollection.get(productDatasheetENG).url }}" target="_blank" class="product-detail-datasheet-link">
  103.                                         <p class="product-detail-datasheet__text"><span class="product-detail-datasheet__label">{{ "product.detail.datasheetLabelENG"|trans }}</span>{% sw_icon 'arrow-down' %}</p>
  104.                                     </a>
  105.                                 </div>
  106.                             {% endif %}
  107.                             </div>
  108.                         </div>
  109.                     {% endblock %}
  110.                     </div>
  111.                 {% endblock %}
  112.                 </div>
  113.                 <div class="product-detail-video-container col-lg-8 col-md-12 col-sm-12" id="video-link-container">
  114.                     {% if page.product.customFields['VideoLink'] matches '{(?:[?&]v=|\/embed\/|\/1\/|\/v\/|https:\/\/(?:www\.)?youtu\.be\/)([^&\n?#]+)}' %}
  115.                         <div style="display:none" id="videolink" data-link="{{ page.product.customFields['VideoLink'] }}"></div>
  116.                         <iframe data-video-frame width="100%" height="600px" style="display:none;"
  117.                                 src="" id="videoIframe">
  118.                         </iframe>
  119.                     {% endif %}
  120.                     {% if videoLink %}
  121.                     {% endif %}
  122.                 </div>
  123.             {% endblock %}
  124.             {% block page_product_detail_cross_selling %}
  125.                 {% if page.crossSellings.elements is defined and page.crossSellings.elements|filter(item => item.total > 0)|length > 0 %}
  126.                     <div class="product-detail-tabs product-detail-cross-selling">
  127.                         {% sw_include '@Storefront/storefront/page/product-detail/cross-selling/tabs.html.twig' with {
  128.                             crossSellings: page.crossSellings
  129.                         } %}
  130.                     </div>
  131.                 {% endif %}
  132.             {% endblock %}
  133.         {% endblock %}
  134.                 </div>
  135.         </div>
  136.     {% endblock %}
  137.     </div>
  138. {% endblock %}