-
-
Save jobthomas/c8bc262b815e5e0d05b29133ba79b2e3 to your computer and use it in GitHub Desktop.
WooCommerce - Adjust the default quantity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple products | |
add_filter( 'woocommerce_quantity_input_args', 'jk_woocommerce_quantity_input_args', 10, 2 ); | |
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) | |
} | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment