Title

WooCommerce default quantity grouped product

description

How to set default quantity in a grouped product to 1 (or x)

Published 2022-09-27

Modified 2022-09-27

content

				
					add_filter( 'woocommerce_quantity_input_args', 'custom_quantity', 10, 2 );

function custom_quantity( $args, $product ) {
global $product;
    if( !$product->is_type( 'grouped' ) ){
        $args['input_value'] = 1;
        return $args;
    else {
        return $args;
    }
}