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

Open in your IDE?
  1. {% block page_product_detail_buy_form_inner %}
  2.     {# @var page \Shopware\Storefront\Page\Product\ProductPage #}
  3.     {# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
  4.     {% set product = page.product %}
  5.  
  6.     <form
  7.         id="productDetailPageBuyProductForm"
  8.         action="{% block page_product_detail_buy_form_action %}{{ path('frontend.checkout.line-item.add') }}{% endblock %}"
  9.         method="post"
  10.         class="buy-widget"
  11.         data-add-to-cart="true">
  12.         {# @deprecated tag:v6.5.0 - Block page_product_detail_buy_form_inner_csrf will be removed. #}
  13.         {% block page_product_detail_buy_form_inner_csrf %}
  14.             {{ sw_csrf('frontend.checkout.line-item.add') }}
  15.         {% endblock %}
  16.         {% set DOWNLOAD_STATE = constant('Shopware\\Core\\Content\\Product\\State::IS_DOWNLOAD') %}
  17.         {% set showQuantitySelect = not product.states is defined or DOWNLOAD_STATE not in product.states or (DOWNLOAD_STATE in product.states and product.maxPurchase !== 1) %}
  18.         {% set buyable = product.available and product.childCount <= 0 and product.calculatedMaxPurchase > 0 %}
  19.         {% block page_product_detail_buy_container %}
  20.             {% if buyable %}
  21.                 <div class="{{ formRowClass }} buy-widget-container">
  22.                     {% block page_product_detail_buy_quantity_container %}
  23.                         {% if showQuantitySelect %}
  24.                             <div class="col-4">
  25.                                 {% set selectQuantityThreshold = 100 %}
  26.                                 {% block page_product_detail_buy_quantity %}
  27.                                     {# @deprecated tag:v6.5.0 - Numeric quantity input with additional plus/minus controls will be the default. #}
  28.                                     {% if (product.calculatedMaxPurchase - product.minPurchase) / product.purchaseSteps > selectQuantityThreshold %}
  29.                                         {% block page_product_detail_buy_quantity_input_group %}
  30.                                             <div class="input-group">
  31.                                             {% block page_product_detail_buy_quantity_input %}
  32.                                                 <input
  33.                                                     type="number"
  34.                                                     name="lineItems[{{ product.id }}][quantity]"
  35.                                                     class="form-control product-detail-quantity-input"
  36.                                                     min="{{ product.minPurchase }}"
  37.                                                     max="{{ product.calculatedMaxPurchase }}"
  38.                                                     step="{{ product.purchaseSteps }}"
  39.                                                     value="{{ product.minPurchase }}"
  40.                                                 />
  41.                                                     {% endblock %}
  42.                                                         {% block page_product_detail_buy_quantity_input_unit %}
  43.                                                             {% if product.translated.packUnit %}
  44.                                                                 {% if not feature('v6.5.0.0') %}
  45.                                                                     <div class="input-group-append">
  46.                                                                 {% endif %}
  47.                                                                 <span class="input-group-text">
  48.                                                                     {% if product.minPurchase > 1 and product.translated.packUnitPlural %}
  49.                                                                         {{ product.translated.packUnitPlural }}
  50.                                                                     {% elseif product.translated.packUnit %}
  51.                                                                         {{ product.translated.packUnit }}
  52.                                                                     {% endif %}
  53.                                                                 </span>
  54.                                                             {% if not feature('v6.5.0.0') %}
  55.                                                         </div>
  56.                                                     {% endif %}
  57.                                                 {% endif %}
  58.                                             {% endblock %}
  59.                                         </div>
  60.                                     {% endblock %}
  61.                                     {% else %}
  62.                                         {% block page_product_detail_buy_quantity_select %}
  63.                                             <select name="lineItems[{{ product.id }}][quantity]"
  64.                                                 class="{{ formSelectClass }} product-detail-quantity-select">
  65.                                                     {% for quantity in range(product.minPurchase, product.calculatedMaxPurchase, product.purchaseSteps) %}
  66.                                                         <option value="{{ quantity }}">
  67.                                                             {{ quantity }}
  68.                                                         {% if quantity == 1 %}
  69.                                                             {% if product.translated.packUnit %} {{ product.translated.packUnit }}{% endif %}
  70.                                                         {% else %}
  71.                                                             {% if product.translated.packUnitPlural %}
  72.                                                                 {{ product.translated.packUnitPlural }}
  73.                                                             {% elseif product.translated.packUnit %}
  74.                                                                 {{ product.translated.packUnit }}
  75.                                                             {% endif %}
  76.                                                         {% endif %}
  77.                                                     </option>
  78.                                                 {% endfor %}
  79.                                             </select>
  80.                                         {% endblock %}
  81.                                     {% endif %}
  82.                                 {% endblock %}
  83.                             </div>
  84.                         {% endif %}
  85.                     {% endblock %}
  86.                     {% block page_product_detail_buy_redirect_input %}
  87.                         {# fallback redirect back to detail page is deactivated via js #}
  88.                         <input type="hidden"
  89.                                name="redirectTo"
  90.                                value="frontend.detail.page">
  91.                         <input type="hidden"
  92.                                name="redirectParameters"
  93.                                data-redirect-parameters="true"
  94.                                value='{"productId": "{{ product.id }}"}'>
  95.                         <input type="hidden"
  96.                                name="deliveryTimeac"
  97.                                data-redirect-parameters="true"
  98.                                value='{{ product.deliveryTime.translation('name') }}'>
  99.                     {% endblock %}
  100.                     {% block page_product_detail_buy_product_buy_info %}
  101.                         <input type="hidden"
  102.                                name="lineItems[{{ product.id }}][id]"
  103.                                value="{{ product.id }}">
  104.                         <input type="hidden"
  105.                                name="lineItems[{{ product.id }}][type]"
  106.                                value="product">
  107.                         <input type="hidden"
  108.                                name="lineItems[{{ product.id }}][referencedId]"
  109.                                value="{{ product.id }}">
  110.                         <input type="hidden"
  111.                                name="lineItems[{{ product.id }}][stackable]"
  112.                                value="1">
  113.                         <input type="hidden"
  114.                                name="lineItems[{{ product.id }}][removable]"
  115.                                value="1">
  116.                     {% endblock %}
  117.                     {% block page_product_detail_product_buy_meta %}
  118.                         <input type="hidden"
  119.                                name="product-name"
  120.                                value="{{ product.translated.name }}">
  121.                         <input type="hidden"
  122.                                name="brand-name"
  123.                                value="{{ product.manufacturer.getName() }}">
  124.                     {% endblock %}
  125.                     {% block page_product_detail_buy_button_container %}
  126.                         <div class="{% if showQuantitySelect %}col-6 xs-btn{% else %}col-12{% endif %} {% if page.extensions['amMactradeapplepayment'].get('applepayenable') is empty %}col-12 {% endif %} " >
  127.                             {% block page_product_detail_buy_button %}
  128.                                 {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
  129.                                 {% if feature('v6.5.0.0') %}
  130.                                     <div class="d-grid">
  131.                                         <button class="btn btn-primary btn-buy"
  132.                                                 title="{{ "detail.addProduct"|trans|striptags }}"
  133.                                                 aria-label="{{ "detail.addProduct"|trans|striptags }}">
  134.                                             {{ "detail.addProduct"|trans|sw_sanitize }}
  135.                                         </button>
  136.                                     </div>
  137.                                 {% else %}
  138.                                     <button class="btn btn-primary btn-block btn-buy"
  139.                                             title="{{ "detail.addProduct"|trans|striptags }}"
  140.                                             aria-label="{{ "detail.addProduct"|trans|striptags }}">
  141.                                         {{ "detail.addProduct"|trans|sw_sanitize }}
  142.                                     </button>
  143.                                 {% endif %}
  144.                             {% endblock %}
  145.                         </div>
  146.             {% if page.extensions['amMactradeapplepayment'].get('applepayenable') %} 
  147.             
  148.             <!--div class="col-6  black-2btn">
  149.                     <button class="btn btn-primary btn-block btn-buy" title="Mit Apple Pay kaufen" aria-label="Mit Apple Pay kaufen" fdprocessedid="izfz0l">
  150.                             Mit Apple Pay kaufen
  151.                     </button>
  152.                 </div-->
  153.             {% endif %}
  154.                     {% endblock %}
  155.             
  156.                 </div>
  157.             {% endif %}
  158.         {% endblock %}
  159.     </form>
  160. {% endblock %}