// Note: This filter a lot of arguments to modify based on your needs
// File name: woocommerce/includes/wc-template-functions.php
function custom_quantity_input_default( $args, $product ) {
$args[‘max_value’] = 80; // Maximum value
$args[‘min_value’] = 2; // Minimum value
$args[‘step’] = 2; // Quantity steps
return $args;
}
add_filter( ‘woocommerce_quantity_input_args’, ‘custom_quantity_input_default’, 10, 2 );
How to update woocommerce qty field input value?
Written by
in
This snippets allows you to override the woocommerce qty field default value using the filter hook.
Woocommerce plugin is very flexible even to set the default value of the qty field for product. Copy and paste the following code to your theme functions.php file