custom/plugins/zenitPlatformStratus/src/Resources/views/storefront/component/product/card/zen-action-buy-widget-container.html.twig line 1

Open in your IDE?
  1. {% block zen_component_product_box_action_buy_widget_container %}
  2.     {% set quantityCol = quantityCol ? quantityCol : 'col-8' %}
  3.     {% set buttonCol = buttonCol ? buttonCol : 'col-4' %}
  4.     {% set selectQuantityThreshold = 100 %}
  5.     {% set selectQuantityThresholdExceeded = (product.calculatedMaxPurchase - product.minPurchase) / product.purchaseSteps > selectQuantityThreshold %}
  6.     {% block zen_component_product_box_action_buy_widget %}
  7.         <div class="buy-widget-container{% if theme_config('zen-buy-quantity-style') is same as ('input') or (theme_config('zen-buy-quantity-style') is same as ('select') and selectQuantityThresholdExceeded) %} quantity-input{% else %} quantity-select{% endif %}">
  8.             {% block zen_component_product_box_action_buy_widget_quantity %}
  9.                 {% if theme_config('zen-buy-quantity-style') is same as ('input') or (theme_config('zen-buy-quantity-style') is same as ('select') and selectQuantityThresholdExceeded) %}
  10.                     {% block zen_component_product_box_action_buy_widget_quantity_zenit_input %}
  11.                         <div class="form-row">
  12.                             <div class="{{ quantityCol }}">
  13.                                 {% sw_include '@zenitPlatformStratus/storefront/component/buy-widget/zen-buy-widget-quantity.html.twig' with {
  14.                                     value: product.value,
  15.                                     id:  product.id,
  16.                                     minPurchase: product.minPurchase,
  17.                                     maxPurchase: product.calculatedMaxPurchase,
  18.                                     step: product.purchaseSteps,
  19.                                     name: "lineItems[#{ product.id }][quantity]",
  20.                                     quantityClasses: 'product-listing-quantity-input'
  21.                                 } %}</div>
  22.                             <div class="{{ buttonCol }}">
  23.                                 <button class="btn btn-block btn-buy{% if theme_config('zen-product-listing-card-actions-quickview') %} btn-icon-only{% endif %}"
  24.                                         title="{{ "listing.boxAddProduct"|trans|striptags }}">
  25.                                     {% sw_icon 'bag' %}
  26.                                 </button>
  27.                             </div>
  28.                         </div>
  29.                     {% endblock %}
  30.                 {% else %}
  31.                     {% block zen_component_product_box_action_buy_widget_quantity_input_group %}
  32.                         <div class="input-group">
  33.                             {% if (product.calculatedMaxPurchase - product.minPurchase) / product.purchaseSteps > selectQuantityThreshold %}
  34.                                 {% block zen_component_product_box_action_buy_widget_quantity_input %}
  35.                                     <input
  36.                                         type="number"
  37.                                         name="lineItems[{{ product.id }}][quantity]"
  38.                                         class="form-control product-listing-quantity-input"
  39.                                         min="{{ product.minPurchase }}"
  40.                                         max="{{ product.calculatedMaxPurchase }}"
  41.                                         step="{{ product.purchaseSteps }}"
  42.                                         value="{{ product.minPurchase }}"
  43.                                     />
  44.                                 {% endblock %}
  45.                             {% else %}
  46.                                 {% block zen_component_product_box_action_buy_widgetquantity_select %}
  47.                                     <select name="lineItems[{{ product.id }}][quantity]"
  48.                                             class="custom-select product-listing-quantity-select">
  49.                                         {% for quantity in range(product.minPurchase, product.calculatedMaxPurchase, product.purchaseSteps) %}
  50.                                             <option value="{{ quantity }}">
  51.                                                 {{ quantity }}
  52.                                                 {% if quantity == 1 %}
  53.                                                     {% if product.translated.packUnit %} {{ product.translated.packUnit }}{% endif %}
  54.                                                 {% else %}
  55.                                                     {% if product.translated.packUnitPlural %}
  56.                                                         {{ product.translated.packUnitPlural }}
  57.                                                     {% elseif product.translated.packUnit %}
  58.                                                         {{ product.translated.packUnit }}
  59.                                                     {% endif %}
  60.                                                 {% endif %}
  61.                                             </option>
  62.                                         {% endfor %}
  63.                                     </select>
  64.                                 {% endblock %}
  65.                             {% endif %}
  66.                             <div class="input-group-append">
  67.                                 <button class="btn btn-block btn-buy{% if theme_config('zen-product-listing-card-actions-quickview') %} btn-icon-only{% endif %}"
  68.                                         title="{{ "listing.boxAddProduct"|trans|striptags }}">
  69.                                     {% sw_icon 'bag' %}
  70.                                 </button>
  71.                             </div>
  72.                         </div>
  73.                     {% endblock %}
  74.                 {% endif %}
  75.             {% endblock %}
  76.         </div>
  77.     {% endblock %}
  78. {% endblock %}