custom/plugins/ApoShop/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.         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.         {% block page_product_detail_buy_form_inner_csrf %}
  13.             {{ sw_csrf('frontend.checkout.line-item.add') }}
  14.         {% endblock %}
  15.         {% set buyable = product.available and product.childCount <= 0 and product.calculatedMaxPurchase > 0 %}
  16.         {% block page_product_detail_buy_container %}
  17.             {% if buyable %}
  18.                 <div class="{{ formRowClass }} buy-widget-container">
  19.                     {% block page_product_detail_buy_quantity_container %}
  20.                         <div class="col-3">
  21.                             {% block page_product_detail_buy_quantity %}
  22.                                 <select name="lineItems[{{ product.id }}][quantity]"
  23.                                         class="{{ formSelectClass }} product-detail-quantity-select">
  24.                                     {% for quantity in range(product.minPurchase, product.calculatedMaxPurchase, product.purchaseSteps) %}
  25.                                         <option value="{{ quantity }} kg">
  26.                                             {{ quantity }} kg
  27.                                             {% if quantity == 1 %}
  28.                                                 {% if product.translated.packUnit %} {{ product.translated.packUnit }}{% endif %}
  29.                                             {% else %}
  30.                                                 {% if product.translated.packUnitPlural %}
  31.                                                     {{ product.translated.packUnitPlural }}
  32.                                                 {% elseif product.translated.packUnit %}
  33.                                                     {{ product.translated.packUnit }}
  34.                                                 {% endif %}
  35.                                             {% endif %}
  36.                                         </option>
  37.                                     {% endfor %}
  38.                                 </select>
  39.                             {% endblock %}
  40.                         </div>
  41.                     {% endblock %}
  42.                     {% block page_product_detail_buy_redirect_input %}
  43.                         {# fallback redirect back to detail page is deactivated via js #}
  44.                         <input type="hidden"
  45.                                name="redirectTo"
  46.                                value="frontend.detail.page">
  47.                         <input type="hidden"
  48.                                name="redirectParameters"
  49.                                data-redirect-parameters="true"
  50.                                value='{"productId": "{{ product.id }}"}'>
  51.                     {% endblock %}
  52.                     {% block page_product_detail_buy_product_buy_info %}
  53.                         <input type="hidden"
  54.                                name="lineItems[{{ product.id }}][id]"
  55.                                value="{{ product.id }}">
  56.                         <input type="hidden"
  57.                                name="lineItems[{{ product.id }}][type]"
  58.                                value="product">
  59.                         <input type="hidden"
  60.                                name="lineItems[{{ product.id }}][referencedId]"
  61.                                value="{{ product.id }}">
  62.                         <input type="hidden"
  63.                                name="lineItems[{{ product.id }}][stackable]"
  64.                                value="1">
  65.                         <input type="hidden"
  66.                                name="lineItems[{{ product.id }}][removable]"
  67.                                value="1">
  68.                     {% endblock %}
  69.                     {% block page_product_detail_product_buy_meta %}
  70.                         <input type="hidden"
  71.                                name="product-name"
  72.                                value="{{ product.translated.name }}">
  73.                         <input type="hidden"
  74.                                name="brand-name"
  75.                                value="{{ product.manufacturer.getName() }}">
  76.                     {% endblock %}
  77.                     {% block page_product_detail_buy_button_container %}
  78.                         {# <div class="col-7">
  79.                             {% block page_product_detail_buy_button %}
  80.                                 {% if feature('v6.5.0.0') %}
  81.                                     <div class="d-grid">
  82.                                         <button class="btn btn-primary btn-buy"
  83.                                                 title="{{ "detail.addProduct"|trans|striptags }}"
  84.                                                 aria-label="{{ "detail.addProduct"|trans|striptags }}">
  85.                                             {{ "detail.addProduct"|trans|sw_sanitize }}
  86.                                         </button>
  87.                                     </div>
  88.                                 {% else %}
  89.                                     <button class="btn btn-primary btn-block btn-buy"
  90.                                             title="{{ "detail.addProduct"|trans|striptags }}"
  91.                                             aria-label="{{ "detail.addProduct"|trans|striptags }}">
  92.                                         {{ "detail.addProduct"|trans|sw_sanitize }}
  93.                                     </button>
  94.                                 {% endif %}
  95.                             {% endblock %}
  96.                         </div> #}
  97.                         {# Custom Gent add to cart #}
  98.                         <div class="col-7">
  99.                             {% block page_product_detail_buy_button %}
  100.                                 {# @deprecated tag:v6.5.0 - Bootstrap v5 removes `btn-block` class, use `d-grid` wrapper instead #}
  101.                                 {% if feature('v6.5.0.0') %}
  102.                                     <div class="d-grid">
  103.                                         {% if product.stock > 0 %}
  104.                                             <button class="btn btn-primary btn-buy"
  105.                                                     title="{{ "detail.addProduct"|trans|striptags }}"
  106.                                                     aria-label="{{ "detail.addProduct"|trans|striptags }}">
  107.                                                 {{ "detail.addProduct"|trans|sw_sanitize }}
  108.                                             </button>
  109.                                         {% else %}
  110.                                             <button class="btn btn-secondary btn-buy" disabled>
  111.                                                 {{ 'add-to-cart-text' | trans | raw }}
  112.                                             </button>
  113.                                         {% endif %}
  114.                                     </div>
  115.                                 {% else %}
  116.                                     {% if product.stock > 0 %}
  117.                                         <button class="btn btn-primary btn-block btn-buy"
  118.                                                 title="{{ "detail.addProduct"|trans|striptags }}"
  119.                                                 aria-label="{{ "detail.addProduct"|trans|striptags }}">
  120.                                             {{ "detail.addProduct"|trans|sw_sanitize }}
  121.                                         </button>
  122.                                     {% else %}
  123.                                         <button class="btn btn-secondary btn-block btn-buy" disabled>
  124.                                             Out of Stock
  125.                                         </button>
  126.                                     {% endif %}
  127.                                 {% endif %}
  128.                             {% endblock %}
  129.                         </div>
  130.                     {% endblock %}
  131. <div class="col-2">
  132.         {% if config('core.cart.wishlistEnabled') %}
  133.             {% block page_product_detail_wishlist %}
  134.                 {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  135.                     showText: true,
  136.                     size: 'md',
  137.                     productId: page.product.id
  138.                 } %}
  139.             {% endblock %}
  140.         {% endif %}
  141. </div>
  142.                 </div>
  143.             {% endif %}
  144.         {% endblock %}
  145.     </form>
  146. {% endblock %}
  147. {# {% block page_product_detail_buy_form_inner %}
  148.     {% set product = page.product %}
  149.     <form
  150.         id="productDetailPageBuyProductForm"
  151.         action="{% block page_product_detail_buy_form_action %}{{ path('frontend.checkout.line-item.add') }}{% endblock %}"
  152.         method="post"
  153.         class="buy-widget"
  154.         data-add-to-cart="true">
  155.         {% block page_product_detail_buy_form_inner_csrf %}
  156.             {{ sw_csrf('frontend.checkout.line-item.add') }}
  157.         {% endblock %}
  158.         {% set buyable = product.available and product.childCount <= 0 and product.calculatedMaxPurchase > 0 %}
  159.         {% block page_product_detail_buy_container %}
  160.             {% if buyable %}
  161.                     {% block page_product_detail_buy_quantity_container %}
  162.                             {% block page_product_detail_buy_quantity %}
  163.                                 <div class="variants-cart-select">
  164.                                     <label>Sofort Lieferbar</label>
  165.                                      <select name="lineItems[{{ product.id }}][quantity]"
  166.                                         class="{{ formSelectClass }} product-detail-quantity-select">
  167.                                     {% for quantity in range(product.minPurchase, product.calculatedMaxPurchase, product.purchaseSteps) %}
  168.                                         <option value="{{ quantity }}">
  169.                                             {{ quantity }}
  170.                                             {% if quantity == 1 %}
  171.                                                 {% if product.translated.packUnit %} {{ product.translated.packUnit }}{% endif %}
  172.                                             {% else %}
  173.                                                 {% if product.translated.packUnitPlural %}
  174.                                                     {{ product.translated.packUnitPlural }}
  175.                                                 {% elseif product.translated.packUnit %}
  176.                                                     {{ product.translated.packUnit }}
  177.                                                 {% endif %}
  178.                                             {% endif %}
  179.                                         </option>
  180.                                     {% endfor %}
  181.                                 </select>
  182.                                 </div>
  183.                             {% endblock %}
  184.                     {% endblock %}
  185.                     {% block page_product_detail_buy_redirect_input %}
  186.                         <input type="hidden"
  187.                                name="redirectTo"
  188.                                value="frontend.detail.page">
  189.                         <input type="hidden"
  190.                                name="redirectParameters"
  191.                                data-redirect-parameters="true"
  192.                                value='{"productId": "{{ product.id }}"}'>
  193.                     {% endblock %}
  194.                     {% block page_product_detail_buy_product_buy_info %}
  195.                         <input type="hidden"
  196.                                name="lineItems[{{ product.id }}][id]"
  197.                                value="{{ product.id }}">
  198.                         <input type="hidden"
  199.                                name="lineItems[{{ product.id }}][type]"
  200.                                value="product">
  201.                         <input type="hidden"
  202.                                name="lineItems[{{ product.id }}][referencedId]"
  203.                                value="{{ product.id }}">
  204.                         <input type="hidden"
  205.                                name="lineItems[{{ product.id }}][stackable]"
  206.                                value="1">
  207.                         <input type="hidden"
  208.                                name="lineItems[{{ product.id }}][removable]"
  209.                                value="1">
  210.                     {% endblock %}
  211.                     {% block page_product_detail_product_buy_meta %}
  212.                         <input type="hidden"
  213.                                name="product-name"
  214.                                value="{{ product.translated.name }}">
  215.                         <input type="hidden"
  216.                                name="brand-name"
  217.                                value="{{ product.manufacturer.getName() }}">
  218.                     {% endblock %}
  219.                     {% block page_product_detail_buy_button_container %}
  220.                             {% block page_product_detail_buy_button %}
  221.                                     <div class="variants-cart-button">
  222.                                         <label>Kostenloser  <u>Verstanden</u>  ab 19</label>
  223.                                         <button class="btn btn-primary btn-block btn-buy"
  224.                                             title="{{ "detail.addProduct"|trans|striptags }}"
  225.                                             aria-label="{{ "detail.addProduct"|trans|striptags }}">
  226.                                             <i class="fa-solid fa-cart-arrow-down"></i> {{ 'detail.addProduct' | trans | raw}}
  227.                                     </button>
  228.                                     </div> 
  229.                             {% endblock %}
  230.                            
  231.                     {% endblock %}
  232.             {% endif %}
  233.         {% endblock %}
  234.     </form>
  235. {% endblock %} #}