Last active
August 29, 2015 14:23
-
-
Save spraveenitpro/1db005951274ef51779d to your computer and use it in GitHub Desktop.
Setup Step, min and max for Simple and Variable products
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 ) { | |
$args['input_value'] = 3; // Starting value | |
$args['max_value'] = 12; // Maximum value | |
$args['min_value'] = 3; // Minimum value | |
$args['step'] = 3; // Quantity steps | |
return $args; | |
} | |
// Variations | |
add_filter( 'woocommerce_available_variation', 'jk_woocommerce_available_variation' ); | |
function jk_woocommerce_available_variation( $args ) { | |
$args['max_qty'] = 12; // Maximum value (variations) | |
$args['min_qty'] = 3; // Minimum value (variations) | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment