Set min and max value to empty string if not set
This commit is contained in:
parent
01a2acabdc
commit
755ede10a3
|
@ -1028,6 +1028,10 @@ if ( ! function_exists( 'woocommerce_quantity_input' ) ) {
|
|||
|
||||
$args = apply_filters( 'woocommerce_quantity_input_args', wp_parse_args( $args, $defaults ), $product );
|
||||
|
||||
// Set min and max value to empty string if not set.
|
||||
$args['min_value'] = isset( $args['min_value'] ) ? $args['min_value'] : '';
|
||||
$args['max_value'] = isset( $args['max_value'] ) ? $args['max_value'] : '';
|
||||
|
||||
// Apply sanity to min/max args - min cannot be lower than 0
|
||||
if ( '' !== $args['min_value'] && is_numeric( $args['min_value'] ) && $args['min_value'] < 0 ) {
|
||||
$args['min_value'] = 0; // Cannot be lower than 0
|
||||
|
|
Loading…
Reference in New Issue