Plugin Author
Vidish
(@vidishp)
@alopex91 Thank you for reaching out. May I know how have you changed step quantity on your site?
@vidishp Hi, I used “Min Max Quantity & Step Control for WooCommerce” but I also used some script in functions.php in the past.
Plugin Author
Vidish
(@vidishp)
@alopex91 Unfortunately we do not offer support for third party plugins. However, if you can let me know which filter you have used for step quantity, then I can try accommodating it in plugin, if it is from woocommerce core.
Thank you!
@vidishp Hi, I’m no php expert but it should look something like this
add_filter( 'woocommerce_quantity_input_args', 'jk_woocommerce_quantity_input_args', 10, 2 ); // Simple products
function jk_woocommerce_quantity_input_args( $args, $product ) {
if ( is_singular( 'product' ) ) {
$args['input_value'] = 2; // Starting value (we only want to affect product pages, not cart)
}
$args['max_value'] = 80; // Maximum value
$args['min_value'] = 2; // Minimum value
$args['step'] = 2; // Quantity steps
return $args;
}
add_filter( 'woocommerce_available_variation', 'jk_woocommerce_available_variation' ); // Variations
function jk_woocommerce_available_variation( $args ) {
$args['max_qty'] = 80; // Maximum value (variations)
$args['min_qty'] = 2; // Minimum value (variations)
return $args;
}
In my specific case I needed to change the step quantity to 0.5
Plugin Author
Vidish
(@vidishp)
@alopex91 I have released a version 2.1.8 with this feature. Also, you will need to add this code to your functions.php file:
add_filter('woocommerce_quantity_input_step', 'wooextend_change_step_value', 10, 2);
function wooextend_change_step_value( $step, $product ) {
$step = 2;
return $step;
}
I hope this helps!
Thank you!
Vidish
-
This reply was modified 4 years, 1 month ago by
Vidish.
This works to the combo quantity, not for single product quantity inside it. It’s still integers.
Plugin Author
Vidish
(@vidishp)
@alopex91 I have checked and the update is for child products’ quantities. Not for main product’s quantity.