custom/plugins/zenitPlatformHorizon/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. {# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
  3. {% set product = page.product %}
  4. {% set selectQuantityThreshold = 100 %}
  5. {% set selectQuantityThresholdExceeded = (product.calculatedMaxPurchase - product.minPurchase) / product.purchaseSteps > selectQuantityThreshold %}
  6. {% if theme_config('zen-buy-quantity-style') is same as ('input') or (theme_config('zen-buy-quantity-style') is same as ('select') and selectQuantityThresholdExceeded) %}
  7.     {% set quantityGridClasses = 'col-auto' %}
  8.     {% set btnGridClasses = 'col' %}
  9. {% else %}
  10.     {% set quantityGridClasses = 'col-4' %}
  11.     {% set btnGridClasses = 'col-8' %}
  12. {% endif %}
  13. {% block page_product_detail_buy_quantity_container %}
  14.     {% if theme_config('zen-product-details-buy-quantity') is not same as (false) %}
  15.         {# ... change col to col-auto #}
  16.         <div class="{{ quantityGridClasses }}">
  17.             {% block page_product_detail_buy_quantity %}
  18.                 {% if theme_config('zen-buy-quantity-style') is same as ('input') or (theme_config('zen-buy-quantity-style') is same as ('select') and selectQuantityThresholdExceeded) %}
  19.                     {% block zen_page_product_detail_buy_quantity_zenit_input %}
  20.                         {% sw_include '@zenitPlatformHorizon/storefront/component/buy-widget/zen-buy-widget-quantity.html.twig' with {
  21.                             value: product.value,
  22.                             id: product.id,
  23.                             minPurchase: product.minPurchase,
  24.                             maxPurchase: product.calculatedMaxPurchase,
  25.                             step: product.purchaseSteps,
  26.                             name: "lineItems[#{product.id}][quantity]",
  27.                             quantityClasses: 'product-detail-quantity-input'
  28.                         } %}
  29.                     {% endblock %}
  30.                 {% else %}
  31.                     {{ parent() }}
  32.                 {% endif %}
  33.             {% endblock %}
  34.         </div>
  35.     {% endif %}
  36. {% endblock %}
  37. {# ... add btnGridClasses #}
  38. {% block page_product_detail_buy_button_container %}
  39.     <div class="{{ btnGridClasses }}">
  40.         {{ block('page_product_detail_buy_button') }}
  41.     </div>
  42. {% endblock %}