custom/plugins/GrimmTheme/src/Resources/views/storefront/page/product-detail/buy-widget-form.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/buy-widget-form.html.twig' %}
  2. {% block page_product_detail_buy_form_inner %}
  3.     {# @var page \Shopware\Storefront\Page\Product\ProductPage #}
  4.     {# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
  5.     {% set product = page.product %}
  6.     <form
  7.         id="productDetailPageBuyProductForm"
  8.         class="show-form-loader show-form-loader-buy-btn"
  9.         action="{% block page_product_detail_buy_form_action %}{{ path('frontend.checkout.line-item.add') }}{% endblock %}"
  10.         method="post"
  11.         data-add-to-cart="true"
  12.         class="buy-widget">
  13.         {% block page_product_detail_buy_form_inner_csrf %}
  14.             {{ sw_csrf('frontend.checkout.line-item.add') }}
  15.         {% endblock %}
  16.         {% set buyable = product.available and product.childCount <= 0 and product.calculatedMaxPurchase > 0 %}
  17.         {% block page_product_detail_buy_container %}
  18.             {% if buyable %}
  19.                 <div class="{{ formRowClass }} buy-widget-container">
  20.                     {% block page_product_detail_buy_quantity_container %}
  21.                         {# show quantity only if request only false #}
  22.                         
  23.                         
  24.                     {% endblock %}
  25.                     {% block page_product_detail_buy_redirect_input %}
  26.                         {# fallback redirect back to detail page is deactivated via js #}
  27.                         <input type="hidden"
  28.                                name="redirectTo"
  29.                                value="frontend.detail.page">
  30.                         <input type="hidden"
  31.                                name="redirectParameters"
  32.                                data-redirect-parameters="true"
  33.                                value='{"productId": "{{ product.id }}"}'>
  34.                     {% endblock %}
  35.                     {% block page_product_detail_buy_product_buy_info %}
  36.                         <input type="hidden"
  37.                                name="lineItems[{{ product.id }}][id]"
  38.                                value="{{ product.id }}">
  39.                         <input type="hidden"
  40.                                name="lineItems[{{ product.id }}][type]"
  41.                                value="product">
  42.                         <input type="hidden"
  43.                                name="lineItems[{{ product.id }}][referencedId]"
  44.                                value="{{ product.id }}">
  45.                         <input type="hidden"
  46.                                name="lineItems[{{ product.id }}][stackable]"
  47.                                value="1">
  48.                         <input type="hidden"
  49.                                name="lineItems[{{ product.id }}][removable]"
  50.                                value="1">
  51.                     {% endblock %}
  52.                     {% block page_product_detail_product_buy_meta %}
  53.                         <input type="hidden"
  54.                                name="product-name"
  55.                                value="{{ product.translated.name }}">
  56.                         <input type="hidden"
  57.                                name="brand-name"
  58.                                value="{{ product.manufacturer.getName() }}">
  59.                     {% endblock %}
  60.                     {% block page_product_detail_buy_button_container %}
  61.                         {% block page_product_detail_price %}
  62.                                     {% set requestOnly = product.translated.customFields.grimm_customfields_productRequest_only %}
  63.                                     {% if requestOnly %}
  64.                                         {# SD:4986 #}
  65.                                         {% set showUVP = product.translated.customFields.grimm_customfields_productRequest_showUVP %}
  66.                                         {% if showUVP %}
  67.                                             {% sw_include '@Storefront/solution360/grimm/product/request-only-uvp-display.html.twig' %}
  68.                                         {% else %}
  69.                                             <div class="product-detail-price-container">
  70.                                                 <p class="product-detail-price">{{ "product.price.priceUponRequest"|trans|sw_sanitize }}</p>
  71.                                             </div>
  72.                                         {% endif %}
  73.                                     {% else %}
  74.                                         <div class="product-detail__discount-info w-100">
  75.                                             {% sw_include '@Storefront/storefront/component/product/card/price-uvp.html.twig' %}
  76.                                             {% sw_include '@Storefront/storefront/component/product/card/price-discount-amount.html.twig' %}
  77.                                         </div>
  78.                                     
  79.                                         <div class="product-detail-price-container row mx-0 col-6 col-md-auto order-1">
  80.                                                 {% sw_include '@Storefront/storefront/component/product/card/price-taxes.html.twig' %}
  81.                                                 {% sw_include '@Storefront/storefront/page/product-detail/buy-widget-price.html.twig' %}
  82.                                                 {% if page.product.purchaseSteps > 1%}
  83.                                                     <span class="grm-price-per-unit" style="font-size: 12px; font-weight: 300;">, Preis pro Stück</span>
  84.                                                 {% endif %}
  85.                                             
  86.                                         </div>
  87.                                     {% endif %}
  88.                                     {% sw_include '@Storefront/storefront/component/product/price-unit-info.html.twig' with { 'product': page.product } %}
  89.                                     
  90.                                     {# show if business customer and > 500 #}
  91.                                     {#  Moved to Index #}
  92.                                     {# {% set requestOnly = product.translated.customFields.grimm_customfields_productRequest_only %}
  93.                                     {% if (product.calculatedPrice.unitPrice >= 500) and (context.taxState == "net") and (requestOnly == false) %}
  94.                                         {% sw_include '@Storefront/solution360/grimm/leasing/leasing-modal.html.twig' 
  95.                                         with {
  96.                                             'price': product.calculatedPrice.unitPrice
  97.                                         }
  98.                                         %}
  99.                                     {% endif %} #}
  100.                                     
  101.                                 {% endblock %}
  102.                             {% block page_product_detail_buy_button %}
  103.                                 {# SD-4986 #}
  104.                                 {% if product.translated.customFields.grimm_customfields_productRequest_only %}
  105.                                     <button class="order-md-2 order-4 col-auto btn btn-request btn-primary font-weight-bold" title="{{ 'detail.requestProduct'|trans|sw_sanitize }}">
  106.                                         {{ "detail.requestProduct"|trans|sw_sanitize }}
  107.                                     </button>
  108.                                 {% else %}
  109.                                     <button class="order-md-2 order-4 col-auto btn btn-block btn-buy font-weight-bold justify-content-center">
  110.                                         <span class="d-sm-inline mr-3">in den Warenkorb</span>
  111.                                         {% sw_icon 'warenkorb' style {'pack': 'grimmtheme', 'namespace': 'GrimmTheme', 'size': 'sm'} %}
  112.                                     </button>
  113.                                 {% endif %}
  114.                             {% endblock %}
  115.                             {% if product.translated.customFields.grimm_customfields_productRequest_only == false %}
  116.                             {% block page_product_detail_buy_quantity %}
  117.                                 {% set counterPluginConfig = {
  118.                                     'minPurchase': product.minPurchase ? product.minPurchase : 1,
  119.                                     'maxPurchase': product.maxPurchase ? product.maxPurchase : 100,
  120.                                     'purchaseSteps': product.purchaseSteps ? product.purchaseSteps : 1
  121.                                 } %}
  122.                                 <div class="order-2 order-md-3 col-6 col-md-auto product-counter d-flex align-items-center" data-counter-plugin data-counter-plugin-options="{{ counterPluginConfig|json_encode }}">
  123.                                     <span class="d-none d-md-inline d-lg-none d-xl-inline product-detail__counter-label">{{ "detail.dataColumnQuantity"|trans|sw_sanitize }}</span>
  124.                                     <button type="button" class="product-counter__field product-counter__btn product-counter__btn--decrease disabled">-</button>
  125.                                     <input type="number" 
  126.                                         value="{{ product.minPurchase }}" 
  127.                                         min="{{ product.minPurchase }}" 
  128.                                         max="{{ product.maxPurchase }}" 
  129.                                         name="lineItems[{{ product.id }}][quantity]" 
  130.                                         class="product-counter__field product-counter__amount"/>
  131.                                     <button type="button" class="product-counter__field product-counter__btn product-counter__btn--increase{% if product.translated.customFields.grimm_customfields_productRequest_only %} disabled{% endif %}" {% if product.translated.customFields.grimm_customfields_productRequest_only %}disabled{% endif %}>+</button>
  132.                                 </div>
  133.                             {% endblock %}
  134.                         {% endif %}
  135.                         <ul class="order-4 d-none d-md-block product-detail__tools no-print col-auto">
  136.                                     {% if config('ShopmProductComparison') %}
  137.                                         <li>
  138.                                             {% sw_include '@Storefront/storefront/component/product/card/compare-button.html.twig' with {
  139.                                             navigationTree: page.header.navigation.tree,
  140.                                             categoryTree: page.product.categoryTree|last,
  141.                                             product: page.product
  142.                                             } only %}
  143.                                         </li>
  144.                                     {% endif %} 
  145.                                     {# <li id="share">
  146.                                         <button type="button" class="share-btn">{% sw_include '@Storefront/solution360/grimm/product/sharing.html.twig' %}</button>
  147.                                     </li> #}
  148.                                     <li>
  149.                                         {% if config('core.cart.wishlistEnabled') %}
  150.                                                 {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  151.                                                     showText: false,
  152.                                                     productId: page.product.id
  153.                                                 } %}
  154.                                         {% endif %}
  155.                                     </li>
  156.                                 </ul>
  157.                                 <div class="order-3 product-detail__guarantee-delivery-container row d-flex d-md-none">
  158.                                     <div class="col-md-4 text-center text-md-left my-1">
  159.                                         <div class="">
  160.                                             <span class="product-detail_guarantee-information">
  161.                                             {# {% sw_icon 'garantie' style {'pack': 'grimmtheme', 'namespace': 'GrimmTheme', 'size': 'xs'} %} #}
  162.                                             {{ "product.freeDelivery"|trans|sw_sanitize }}
  163.                                             </span>
  164.                                         </div>
  165.                                         {# {% sw_include '@Storefront/storefront/page/product-detail/delivery-info.html.twig' %} #}
  166.                                     </div>
  167.                                     {% if product.translated.customFields.grimm_customFields_guarantee %}
  168.                                     <div class="col-md-4 text-center text-md-left my-1">
  169.                                         <div class="">
  170.                                             <span class="product-detail_guarantee-information">
  171.                                             {# {% sw_icon 'garantie' style {'pack': 'grimmtheme', 'namespace': 'GrimmTheme', 'size': 'xs'} %} #}
  172.                                             {{ product.translated.customFields.grimm_customFields_guarantee }}
  173.                                             </span>
  174.                                         </div>
  175.                                     </div>
  176.                                     {% endif %}
  177.                                     <div class="col-md-4 text-center text-md-left my-1">
  178.                                         <div class="">
  179.                                             {# <span class="product-detail-delivery-information"> #}
  180.                                                 {% sw_include '@Storefront/storefront/component/product/card/product-delivery-info.html.twig' %}
  181.                                             {# </span> #}
  182.                                         </div>
  183.                                     </div>
  184.                                 </div>
  185.                     {% endblock %}
  186.                 </div>
  187.                 <div class="product-detail__guarantee-delivery-container row d-none d-md-flex">
  188.                                     <div class="col-md-4 text-center text-md-left my-1">
  189.                                         <div class="">
  190.                                             <span class="product-detail_guarantee-information">
  191.                                             {# {% sw_icon 'garantie' style {'pack': 'grimmtheme', 'namespace': 'GrimmTheme', 'size': 'xs'} %} #}
  192.                                             {{ "product.freeDelivery"|trans|sw_sanitize }}
  193.                                             </span>
  194.                                         </div>
  195.                                         {# {% sw_include '@Storefront/storefront/page/product-detail/delivery-info.html.twig' %} #}
  196.                                     </div>
  197.                                     {% if product.translated.customFields.grimm_customFields_guarantee %}
  198.                                     <div class="col-md-4 text-center text-md-left my-1">
  199.                                         <div class="">
  200.                                             <span class="product-detail_guarantee-information">
  201.                                             {# {% sw_icon 'garantie' style {'pack': 'grimmtheme', 'namespace': 'GrimmTheme', 'size': 'xs'} %} #}
  202.                                             {{ product.translated.customFields.grimm_customFields_guarantee }}
  203.                                             </span>
  204.                                         </div>
  205.                                     </div>
  206.                                     {% endif %}
  207.                                     <div class="col-md-4 text-center text-md-left my-1">
  208.                                         <div class="">
  209.                                             {# <span class="product-detail-delivery-information"> #}
  210.                                                 {% sw_include '@Storefront/storefront/component/product/card/product-delivery-info.html.twig' %}
  211.                                             {# </span> #}
  212.                                         </div>
  213.                                     </div>
  214.                                 </div>
  215.                 {% sw_include '@Storefront/storefront/component/buy-widget/buy-widget-form-customized-products.html.twig' %}
  216.             {% endif %}
  217.         {% endblock %}
  218.     </form>
  219. {% endblock %}