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.                     {% set remoteClickOptions = {
  113.                         selector: "#review-tab-" ~ product.id,
  114.                         scrollToElement: true
  115.                     } %}
  116.                     {% set reviewTabHref = "#review-tab-" ~ product.id ~ "-pane" %}
  117.                     {% block buy_widget_reviews %}
  118.                         {% if product.ratingAverage > 0 and totalReviews > 0 and config('core.listing.showReview') %}
  119.                             <div class="product-detail-reviews">
  120.                                 {% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
  121.                                     points: product.ratingAverage,
  122.                                     style: 'text-primary'
  123.                                 } %}
  124.                                 <a {{ dataBsToggleAttr }}="tab"
  125.                                    class="product-detail-reviews-link"
  126.                                    data-offcanvas-tabs="true"
  127.                                    data-remote-click="true"
  128.                                    data-remote-click-options='{{ remoteClickOptions|json_encode }}'
  129.                                    href="{{ reviewTabHref }}"
  130.                                    aria-controls="review-tab-pane">
  131.                                     {{ totalReviews }}
  132.                                     {{ "detail.reviewLinkText"|trans({'%count%': totalReviews})|sw_sanitize }}
  133.                                 </a>
  134.                             </div>
  135.                         {% endif %}
  136.                     {% endblock %}
  137.                     {% block buy_widget_delivery_informations %}
  138.                         <div class="product-detail-delivery-information">
  139.                             {% sw_include '@Storefront/storefront/component/delivery-information.html.twig' %}
  140.                         </div>
  141.                     {% endblock %}
  142.                 {% endblock %}
  143.                 {% block buy_widget_configurator_include %}
  144.                     {% if product.parentId and configuratorSettings|length > 0 %}
  145.                         <div class="product-detail-configurator-container">
  146.                             {% sw_include '@Storefront/storefront/component/buy-widget/configurator.html.twig' %}
  147.                         </div>
  148.                     {% endif %}
  149.                 {% endblock %}
  150.                 {% block buy_widget_buy_form %}
  151.                     {% if product.active %}
  152.                         <div class="product-detail-form-container">
  153.                             {% sw_include '@Storefront/storefront/component/buy-widget/buy-widget-form.html.twig' %}
  154.                         </div>
  155.                     {% endif %}
  156.                 {% endblock %}
  157.             </div>
  158.         {% endblock %}
  159.         {% if config('core.cart.wishlistEnabled') %}
  160.             {% block buy_widget_wishlist %}
  161.                 {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  162.                     showText: true,
  163.                     size: 'md',
  164.                     productId: product.id
  165.                 } %}
  166.             {% endblock %}
  167.         {% endif %}
  168.         {% block buy_widget_ordernumber_container %}
  169.             {% if product.productNumber %}
  170.                 <div class="product-detail-ordernumber-container">
  171.                     {% block buy_widget_ordernumber_label %}
  172.                         <span class="product-detail-ordernumber-label">
  173.                             {{ "detail.productNumberLabel"|trans|sw_sanitize }}
  174.                         </span>
  175.                     {% endblock %}
  176.                     {% block buy_widget_ordernumber %}
  177.                         <meta itemprop="productID"
  178.                               content="{{ product.id }}"/>
  179.                         <span class="product-detail-ordernumber"
  180.                               itemprop="sku">
  181.                             {{ product.productNumber }}
  182.                         </span>
  183.                     {% endblock %}
  184.                 </div>
  185.             {% endif %}
  186.         {% endblock %}
  187.     </div>
  188. {% endblock %}