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