Plugin Support
Rynald0s.a11n
(@rynald0s)
Automattic Happiness Engineer
Hi @marknopfler!
You could use the following to see if that helps:
add_filter( 'woocommerce_quantity_input_args', 'custom_quantity', 10, 2 );
function custom_quantity( $args, $product ) {
$args['input_value'] = 1;
return $args;
}
You can read more about how to add this code to your site here:
http://rynaldo.com/how-to-add-custom-code-to-your-woocommerce-wordpress-site-the-right-way/
Ps. Great fan of Mark Knopfler 😀
Cheers!
Oh it works!
You made my day!
Knopfler appreciates you! 😉
Plugin Support
Rynald0s.a11n
(@rynald0s)
Automattic Happiness Engineer
Haha! Nice!
Have a good one, Mark!
Hi @rynald0s,
The code works for Grouped Products but when I goto Cart page it allways shows “1” on Quantity. If I update cart with “2” it updates the subtotal but it shows “1” on Quantity.
Is there any way that the code work only for Grouped Products and not on cart page?
Thanks!!!
A quick solution if someone needs it:
add_filter( 'woocommerce_quantity_input_args', 'custom_quantity', 10, 2 );
function custom_quantity( $args, $product ) {
if (is_page(8)) {
return $args;
} else {
$args['input_value'] = 1;
return $args;
}
}
Just modify the id 8 (is_page(8)) for your cart ID page