Only add when using intval for stock amounts
This commit is contained in:
parent
111b72c159
commit
e9ff396348
|
@ -1001,7 +1001,9 @@ if ( ! function_exists( 'woocommerce_quantity_input' ) ) {
|
|||
'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 )
|
||||
'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 );
|
||||
|
|
|
@ -21,5 +21,5 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
}
|
||||
?>
|
||||
<div class="quantity">
|
||||
<input type="number" step="<?php echo esc_attr( $step ); ?>" min="<?php echo esc_attr( $min_value ); ?>" max="<?php echo esc_attr( $max_value ); ?>" name="<?php echo esc_attr( $input_name ); ?>" value="<?php echo esc_attr( $input_value ); ?>" title="<?php echo esc_attr_x( 'Qty', 'Product quantity input tooltip', 'woocommerce' ) ?>" class="input-text qty text" size="4" pattern="[0-9]*" inputmode="numeric" />
|
||||
<input type="number" step="<?php echo esc_attr( $step ); ?>" min="<?php echo esc_attr( $min_value ); ?>" max="<?php echo esc_attr( $max_value ); ?>" name="<?php echo esc_attr( $input_name ); ?>" value="<?php echo esc_attr( $input_value ); ?>" title="<?php echo esc_attr_x( 'Qty', 'Product quantity input tooltip', 'woocommerce' ) ?>" class="input-text qty text" size="4" pattern="<?php echo esc_attr( $pattern ); ?>" inputmode="<?php echo esc_attr( $inputmode ); ?>" />
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue