diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index 9ca9633faf7..23905c05b5c 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -997,11 +997,13 @@ if ( ! function_exists( 'woocommerce_quantity_input' ) ) { } $defaults = array( - 'input_name' => 'quantity', - 'input_value' => '1', - 'max_value' => apply_filters( 'woocommerce_quantity_input_max', '', $product ), - 'min_value' => apply_filters( 'woocommerce_quantity_input_min', '', $product ), - 'step' => apply_filters( 'woocommerce_quantity_input_step', '1', $product ) + 'input_name' => 'quantity', + 'input_value' => '1', + 'max_value' => apply_filters( 'woocommerce_quantity_input_max', '', $product ), + 'min_value' => apply_filters( 'woocommerce_quantity_input_min', '', $product ), + 'step' => apply_filters( 'woocommerce_quantity_input_step', '1', $product ), + 'pattern' => apply_filters( 'woocommerce_quantity_input_pattern', has_filter( 'woocommerce_stock_amount', 'intval' ) ? '[0-9]*' : '' ), + 'inputmode' => apply_filters( 'woocommerce_quantity_input_inputmode', has_filter( 'woocommerce_stock_amount', 'intval' ) ? 'numeric' : '' ), ); $args = apply_filters( 'woocommerce_quantity_input_args', wp_parse_args( $args, $defaults ), $product ); diff --git a/templates/global/quantity-input.php b/templates/global/quantity-input.php index 86c22f09150..ee334d8ab04 100644 --- a/templates/global/quantity-input.php +++ b/templates/global/quantity-input.php @@ -21,5 +21,5 @@ if ( ! defined( 'ABSPATH' ) ) { } ?>