vendor/shopware/storefront/Resources/views/storefront/component/buy-widget/buy-widget.html.twig line 1

Open in your IDE?
  1. {% block buy_widget %}
  2.     <div class="product-detail-buy{% if elementId %}-{{ elementId }}{% endif %} js-magnifier-zoom-image-container">
  3.         {% block buy_widget_rich_snippets %}
  4.             {% block buy_widget_rich_snippets_brand %}
  5.                 {% if product.manufacturer %}
  6.                     <div itemprop="brand" itemtype="https://schema.org/Brand" itemscope>
  7.                         <meta itemprop="name" content="{{ product.manufacturer.translated.name }}" />
  8.                     </div>
  9.                 {% endif %}
  10.             {% endblock %}
  11.             {% block buy_widget_rich_snippets_gtin13 %}
  12.                 {% if product.ean %}
  13.                     <meta itemprop="gtin13"
  14.                           content="{{ product.ean }}"/>
  15.                 {% endif %}
  16.             {% endblock %}
  17.             {% block buy_widget_rich_snippets_mpn %}
  18.                 {% if product.manufacturerNumber %}
  19.                     <meta itemprop="mpn"
  20.                           content="{{ product.manufacturerNumber }}"/>
  21.                 {% endif %}
  22.             {% endblock %}
  23.             {% block buy_widget_rich_snippets_weight %}
  24.                 {% if product.weight %}
  25.                     <meta itemprop="weight"
  26.                           content="{{ product.weight }} kg"/>
  27.                 {% endif %}
  28.             {% endblock %}
  29.             {% block buy_widget_rich_snippets_height %}
  30.                 {% if product.height %}
  31.                     <meta itemprop="height"
  32.                           content="{{ product.height }} mm"/>
  33.                 {% endif %}
  34.             {% endblock %}
  35.             {% block buy_widget_rich_snippets_width %}
  36.                 {% if product.width %}
  37.                     <meta itemprop="width"
  38.                           content="{{ product.width }} mm"/>
  39.                 {% endif %}
  40.             {% endblock %}
  41.             {% block buy_widget_rich_snippets_depth %}
  42.                 {% if product.length %}
  43.                     <meta itemprop="depth"
  44.                           content="{{ product.length }} mm"/>
  45.                 {% endif %}
  46.             {% endblock %}
  47.             {% block buy_widget_rich_snippets_release_date %}
  48.                 <meta itemprop="releaseDate"
  49.                       content="{{ product.releaseDate|format_date(pattern="Y-MM-dd", locale=app.request.locale) }}"/>
  50.             {% endblock %}
  51.         {% endblock %}
  52.         {% if not feature('FEATURE_NEXT_16992') %}
  53.             {# @deprecated tag:v6.5.0 tag:)(FEATURE_NEXT_16992) - Block will be removed in v6.5.0 #}
  54.             {% block buy_widget_not_available %}
  55.             {% endblock %}
  56.         {% endif %}
  57.         {% block buy_widget_buy_container %}
  58.             <div itemprop="offers"
  59.                  itemscope
  60.                  itemtype="{% if product.calculatedPrices|length > 1 %}http://schema.org/AggregateOffer{% else %}http://schema.org/Offer{% endif %}">
  61.                 {% block buy_widget_data %}
  62.                     {% block buy_widget_data_rich_snippet_url %}
  63.                         <meta itemprop="url"
  64.                               content="{{ seoUrl('frontend.detail.page', { productId: product.id }) }}"/>
  65.                     {% endblock %}
  66.                     {% block buy_widget_data_rich_snippet_price_range %}
  67.                         {% if product.calculatedPrices|length > 1 %}
  68.                             {% set lowestPrice = false %}
  69.                             {% set highestPrice = false %}
  70.                             {% for price in product.calculatedPrices %}
  71.                                 {% if not lowestPrice or price.unitPrice < lowestPrice %}
  72.                                     {% set lowestPrice = price.unitPrice %}
  73.                                 {% endif %}
  74.                                 {% if not highestPrice or price.unitPrice > highestPrice %}
  75.                                     {% set highestPrice = price.unitPrice %}
  76.                                 {% endif %}
  77.                             {% endfor %}
  78.                             <meta itemprop="lowPrice" content="{{ lowestPrice }}"/>
  79.                             <meta itemprop="highPrice" content="{{ highestPrice }}"/>
  80.                             <meta itemprop="offerCount" content="{{ product.calculatedPrices|length }}"/>
  81.                         {% endif %}
  82.                     {% endblock %}
  83.                     {% block buy_widget_data_rich_snippet_price_currency %}
  84.                         <meta itemprop="priceCurrency"
  85.                               content="{{ context.currency.translated.shortName }}"/>
  86.                     {% endblock %}
  87.                     {% block buy_widget_price %}
  88.                         <div class="product-detail-price-container">
  89.                             {% sw_include '@Storefront/storefront/component/buy-widget/buy-widget-price.html.twig' %}
  90.                         </div>
  91.                     {% endblock %}
  92.                     {% block buy_widget_tax %}
  93.                         <div class="product-detail-tax-container">
  94.                             {% if context.taxState == "gross" %}
  95.                                 {% set taxText = "general.grossTaxInformation"|trans|sw_sanitize %}
  96.                             {% else %}
  97.                                 {% set taxText = "general.netTaxInformation"|trans|sw_sanitize %}
  98.                             {% endif %}
  99.                             <p class="product-detail-tax">
  100.                                 {% block buy_widget_tax_link %}
  101.                                     <a class="product-detail-tax-link"
  102.                                        href="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}"
  103.                                        title="{{ taxText }}"
  104.                                        {{ dataBsToggleAttr }}="modal"
  105.                                        data-url="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}">
  106.                                         {{ taxText }}
  107.                                     </a>
  108.                                 {% endblock %}
  109.                             </p>
  110.                         </div>
  111.                     {% endblock %}
  112.                     {# @deprecated tag:v6.5.0 - Will be removed - The variable will be moved into block `buy_widget_reviews` #}
  113.                     {% set remoteClickOptions = {
  114.                         selector: "#review-tab-" ~ product.id,
  115.                         scrollToElement: true
  116.                     } %}
  117.                     {# @deprecated tag:v6.5.0 - Will be removed - The variable will be moved into block `buy_widget_reviews` #}
  118.                     {% set reviewTabHref = "#review-tab-" ~ product.id ~ "-pane" %}
  119.                     {% block buy_widget_reviews %}
  120.                         {% if product.ratingAverage > 0 and totalReviews > 0 and config('core.listing.showReview') %}
  121.                             {% if remoteClickOptions is not defined %}
  122.                                 {% set remoteClickOptions = {
  123.                                     selector: "#review-tab-" ~ product.id,
  124.                                     scrollToElement: true
  125.                                 } %}
  126.                             {% endif %}
  127.                             {% if reviewTabHref is not defined %}
  128.                                 {% set reviewTabHref = "#review-tab-" ~ product.id ~ "-pane" %}
  129.                             {% endif %}
  130.                             <div class="product-detail-reviews">
  131.                                 {% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
  132.                                     points: product.ratingAverage,
  133.                                     style: 'text-primary'
  134.                                 } %}
  135.                                 <a {{ dataBsToggleAttr }}="tab"
  136.                                    class="product-detail-reviews-link"
  137.                                    data-offcanvas-tabs="true"
  138.                                    data-remote-click="true"
  139.                                    data-remote-click-options='{{ remoteClickOptions|json_encode }}'
  140.                                    href="{{ reviewTabHref }}"
  141.                                    aria-controls="review-tab-pane">
  142.                                     {{ totalReviews }}
  143.                                     {{ "detail.reviewLinkText"|trans({'%count%': totalReviews})|sw_sanitize }}
  144.                                 </a>
  145.                             </div>
  146.                         {% endif %}
  147.                     {% endblock %}
  148.                     {% block buy_widget_delivery_informations %}
  149.                         <div class="product-detail-delivery-information">
  150.                             {% sw_include '@Storefront/storefront/component/delivery-information.html.twig' %}
  151.                         </div>
  152.                     {% endblock %}
  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_buy_form %}
  162.                     {% if product.active %}
  163.                         <div class="product-detail-form-container">
  164.                             {% sw_include '@Storefront/storefront/component/buy-widget/buy-widget-form.html.twig' %}
  165.                         </div>
  166.                     {% endif %}
  167.                 {% endblock %}
  168.             </div>
  169.         {% endblock %}
  170.         {% if config('core.cart.wishlistEnabled') %}
  171.             {% block buy_widget_wishlist %}
  172.                 {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  173.                     showText: true,
  174.                     size: 'md',
  175.                     productId: product.id
  176.                 } %}
  177.             {% endblock %}
  178.         {% endif %}
  179.         {% block buy_widget_ordernumber_container %}
  180.             {% if product.productNumber %}
  181.                 <div class="product-detail-ordernumber-container">
  182.                     {% block buy_widget_ordernumber_label %}
  183.                         <span class="product-detail-ordernumber-label">
  184.                             {{ "detail.productNumberLabel"|trans|sw_sanitize }}
  185.                         </span>
  186.                     {% endblock %}
  187.                     {% block buy_widget_ordernumber %}
  188.                         <meta itemprop="productID"
  189.                               content="{{ product.id }}"/>
  190.                         <span class="product-detail-ordernumber"
  191.                               itemprop="sku">
  192.                             {{ product.productNumber }}
  193.                         </span>
  194.                     {% endblock %}
  195.                 </div>
  196.             {% endif %}
  197.         {% endblock %}
  198.     </div>
  199. {% endblock %}