{# # Quantity Input (Bootstrap 5 Override) # # Replaces WooCommerce's quantity input with a Bootstrap 5 input-group # featuring decrement/increment buttons. # # Expected context (from WooCommerce woocommerce_quantity_input()): # input_id - Input element ID # input_name - Input element name attribute # input_value - Current quantity value # min_value - Minimum allowed quantity # max_value - Maximum allowed quantity (0 = no max) # step - Step increment # placeholder - Placeholder text # inputmode - Input mode (e.g., 'numeric') # classes - CSS class(es) for the input # readonly - Whether input is read-only # type - Input type attribute # args - Additional args (product_name for accessible label) # autocomplete - Autocomplete attribute value # # WooCommerce PHP equivalent: global/quantity-input.php # # @package WcBootstrap # @since 0.1.0 #} {% set label = args.product_name is defined and args.product_name ? __('%s quantity')|format(args.product_name) : __('Quantity') %}
{{ do_action('woocommerce_before_quantity_input_field') }} {% if not readonly %} {% endif %} 0 %}max="{{ max_value|esc_attr }}"{% endif %} {% if not readonly %} step="{{ step|esc_attr }}" placeholder="{{ placeholder|esc_attr }}" inputmode="{{ inputmode|default('numeric')|esc_attr }}" autocomplete="{{ autocomplete|default('on')|esc_attr }}" {% endif %} /> {% if not readonly %} {% endif %} {{ do_action('woocommerce_after_quantity_input_field') }}