custom/plugins/WynTheme/src/Resources/views/storefront/component/buy-widget/buy-widget.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/buy-widget/buy-widget.html.twig' %}
  2. {% block buy_widget %}
  3.   <div class="product-detail-buy-box-container product-detail-buy{% if elementId %}-{{ elementId }}{% endif %} js-magnifier-zoom-image-container">
  4.     {% block buy_widget_rich_snippets %}
  5.       {{ parent() }}
  6.     {% endblock %}
  7.     {% if not feature('FEATURE_NEXT_16992') %}
  8.       {# @deprecated tag:v6.5.0 tag:)(FEATURE_NEXT_16992) - Block will be removed in v6.5.0 #}
  9.       {% block buy_widget_not_available %}
  10.       {% endblock %}
  11.     {% endif %}
  12.     <div class="product-first-row">
  13.       <div class="chip">
  14.         {{ product.seoCategory.translated.name }}
  15.       </div>
  16.     </div>
  17.     <div class="product-first-row-buttons">
  18. {#      TODO class="btn btn-icon btn-icon--light btn-icon--small btn-icon--with-shadow js-add-product-to-comparison js-tooltip"#}
  19.       <wyn-button
  20.         variant="secondary"
  21.         size="small"
  22.         icon-button
  23.         class="js-add-product-to-comparison js-tooltip"
  24.         data-product-id="{{ product.id }}"
  25.         data-product-name="{{ product.translated.name }}"
  26.         title="{{ "Vergleichen"|trans|striptags }}"
  27.       >
  28.         {% sw_icon 'compare' style { 'slotAttr': 'icon' } %}
  29.       </wyn-button>
  30.       {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  31.         showText: false,
  32.         size: 'md',
  33.         productId: product.id
  34.       } %}
  35.     </div>
  36.     <h1 class="product-detail-name" itemprop="name">
  37.       {{ product.translated.name|raw }}
  38.     </h1>
  39.     {% block buy_widget_buy_container %}
  40.       <div
  41.         class="product-detail-buy-box-content"
  42.         itemprop="offers"
  43.         itemscope
  44.         itemtype="{% if product.calculatedPrices|length > 1 %}http://schema.org/AggregateOffer{% else %}http://schema.org/Offer{% endif %}"
  45.       >
  46.         {% block buy_widget_data %}
  47.           {% block buy_widget_data_rich_snippet_url %}
  48.             {{ parent() }}
  49.           {% endblock %}
  50.           {% block buy_widget_data_rich_snippet_price_range %}
  51.             {{ parent() }}
  52.           {% endblock %}
  53.           {% block buy_widget_data_rich_snippet_price_currency %}
  54.             {{ parent() }}
  55.           {% endblock %}
  56.           {# Product number #}
  57.           {% block buy_widget_ordernumber_container %}
  58.             {% if product.productNumber %}
  59.               <div class="product-detail-ordernumber-container">
  60.                 {% block buy_widget_ordernumber_label %}
  61.                   <span class="product-detail-ordernumber-label">
  62.                     {{ "detail.productNumberLabel"|trans|sw_sanitize }}
  63.                   </span>
  64.                 {% endblock %}
  65.                 {% block buy_widget_ordernumber %}
  66.                   <meta
  67.                     itemprop="productID"
  68.                     content="{{ product.id }}"
  69.                   />
  70.                   <span
  71.                     class="product-detail-ordernumber"
  72.                     itemprop="sku"
  73.                   >
  74.                     {{ product.productNumber }}
  75.                   </span>
  76.                 {% endblock %}
  77.               </div>
  78.             {% endif %}
  79.           {% endblock %}
  80.           {# Review info #}
  81.           {% set remoteClickOptions = {
  82.             selector: "#review-tab-" ~ product.id,
  83.             scrollToElement: true
  84.           } %}
  85.           {% set reviewTabHref = "#review-tab-" ~ product.id ~ "-pane" %}
  86.           {% block buy_widget_reviews %}
  87.             {% if product.ratingAverage > 0 and totalReviews > 0 and config('core.listing.showReview') %}
  88.               <div class="product-detail-reviews">
  89.                 {% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
  90.                   points: product.ratingAverage,
  91.                   style: 'text-primary'
  92.                 } %}
  93.                 <a
  94.                   data-toggle="tab"
  95.                   class="product-detail-reviews-link"
  96.                   data-offcanvas-tabs="true"
  97.                   data-remote-click="true"
  98.                   data-remote-click-options='{{ remoteClickOptions|json_encode }}'
  99.                   href="{{ reviewTabHref }}"
  100.                   aria-controls="review-tab-pane"
  101.                 >
  102.                   ({{ totalReviews }})
  103.                 </a>
  104.               </div>
  105.             {% endif %}
  106.           {% endblock %}
  107.         {% endblock %}
  108.         <div class="product-properties">
  109.           {% for property in product.sortedProperties.elements %}
  110.             <div class="product-properties__label">
  111.               {{ property.translated.name }}:
  112.             </div>
  113.             {% for option in property.options.elements %}
  114.               {% if loop.index > 1 %}
  115.                 <div></div>
  116.               {% endif %}
  117.               {% if option.colorHexCode %}
  118.                 <div
  119.                   class="product-properties__value {% if option.colorHexCode == '#ffffffff' %}product-properties__value--white{% endif %}"
  120.                   style="color: {{ option.colorHexCode }};"
  121.                 >
  122.                   <div class="product-properties__color-icon"></div>
  123.                   {{ option.translated.name }}
  124.                 </div>
  125.               {% else %}
  126.                 <div class="product-properties__value">
  127.                   {{ option.translated.name }}
  128.                 </div>
  129.               {% endif %}
  130.             {% endfor %}
  131.           {% endfor %}
  132.           {% if product.purchaseUnit %}
  133.             <div class="product-properties__label">
  134.               {{ 'detail.amount'|trans }}:
  135.             </div>
  136.             <div class="product-properties__value">
  137.               {{ product.purchaseUnit }}
  138.               {{ product.unit.translated.name }}
  139.             </div>
  140.           {% endif %}
  141.         </div>
  142.         {% block buy_widget_configurator_include %}
  143.           {% if product.parentId and configuratorSettings|length > 0 %}
  144.             <div class="product-detail-configurator-container">
  145.               {% sw_include '@Storefront/storefront/component/buy-widget/configurator.html.twig' %}
  146.             </div>
  147.           {% endif %}
  148.         {% endblock %}
  149.         {% block buy_widget_price %}
  150.           <div class="product-detail-price-container">
  151.             {% sw_include '@Storefront/storefront/component/buy-widget/buy-widget-price.html.twig' %}
  152.           </div>
  153.         {% endblock %}
  154.         {% block buy_widget_tax %}
  155.           <div class="product-detail-tax-container">
  156.             {% if context.taxState == "gross" %}
  157.               {% set taxText = "general.grossTaxInformation"|trans|sw_sanitize %}
  158.             {% else %}
  159.               {% set taxText = "general.netTaxInformation"|trans|sw_sanitize %}
  160.             {% endif %}
  161.             <p class="product-detail-tax">
  162.               {% block buy_widget_tax_link %}
  163.                 <a
  164.                   class="product-detail-tax-link"
  165.                   href="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}"
  166.                   title="{{ taxText }}"
  167.                   data-toggle="modal"
  168.                   data-url="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}"
  169.                 >
  170.                   * {{ taxText }}
  171.                 </a>
  172.               {% endblock %}
  173.             </p>
  174.           </div>
  175.         {% endblock %}
  176.         {% block buy_widget_buy_form %}
  177.           {% if product.active %}
  178.             <div class="product-detail-form-container">
  179.               {% sw_include '@Storefront/storefront/component/buy-widget/buy-widget-form.html.twig' %}
  180.             </div>
  181.           {% endif %}
  182.         {% endblock %}
  183.         {% block buy_widget_delivery_informations %}
  184.           <div class="product-detail-delivery-information">
  185.             {% sw_include '@Storefront/storefront/component/delivery-information.html.twig' %}
  186.           </div>
  187.         {% endblock %}
  188.       </div>
  189.     {% endblock %}
  190.     {% if config('core.cart.wishlistEnabled') %}
  191.       {% block buy_widget_wishlist %}
  192.         {# No wishlist button here #}
  193.       {% endblock %}
  194.     {% endif %}
  195.     {% block buy_widget_share_buttons %}
  196.       {% if product.customFields.wyn_products_socialmedia_share_|length > 0 %}
  197.         <div class="share-links">
  198.           <div class="share-links__text">
  199.             {{ 'detail.shareProduct'|trans }}
  200.           </div>
  201.           <ul class="share-links__list">
  202.             {% for socialmedia_share in product.customFields.wyn_products_socialmedia_share_ %}
  203.               {% if socialmedia_share == 'whatsapp' %}
  204.                 {% set name = 'WhatsApp' %}
  205.               {% elseif socialmedia_share == 'twitter' %}
  206.                 {% set name = 'Twitter' %}
  207.               {% elseif socialmedia_share == 'instagram' %}
  208.                 {% set name = 'Instagram' %}
  209.               {% elseif socialmedia_share == 'facebook' %}
  210.                 {% set name = 'Facebook' %}
  211.               {% elseif socialmedia_share == 'reddit' %}
  212.                 {% set name = 'Reddit' %}
  213.               {% elseif socialmedia_share == 'linkedin' %}
  214.                 {% set name = 'LinkedIn' %}
  215.               {% else %}
  216.                 {% set name = '' %}
  217.               {% endif %}
  218.               <li class="share-links__item">
  219.                 <wyn-button
  220.                   variant="secondary"
  221.                   icon-button
  222.                   class="js-share js-tooltip"
  223.                   title="{{ name }}"
  224.                   data-social-site="{{ socialmedia_share }}"
  225.                   data-social-text="{{ product.translated.name|raw }}"
  226.                 >
  227.                   {% sw_include "@Storefront/storefront/utilities/icon.html.twig" with { 'name': socialmedia_share, 'slotAttr': 'icon' } %}
  228.                 </wyn-button>
  229.               </li>
  230.             {% endfor %}
  231.           </ul>
  232.         </div>
  233.       {% endif %}
  234.     {% endblock %}
  235.   </div>
  236. {% endblock %}