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