On woocommerce_available_variation
hook the $args
array doesn't include input_value
argument.
Also You are not using has_term()
conditional function in the right way for product categories.
So try the following code instead:
add_filter( 'woocommerce_available_variation', 'customizing_available_variation', 10, 3 ); // Variations
function customizing_available_variation( $args, $product, $variation ) {
if( has_term( 'flyer', 'product_cat', $product->get_id() ) ) {
$args['max_qty'] = 10000; // Maximum value (variations)
$args['min_qty'] = 500;
// $args['input_value'] = 500; // This argument doesn't exist here
}
return $args;
}
add_filter( 'woocommerce_quantity_input_args', 'customizing_quantity_input_args', 10, 2 );
function customizing_quantity_input_args( $args, $product ) {
if( $product->is_type('variable') && has_term( 'flyer', 'product_cat', $product->get_id() ) ) {
$args['max_value'] = 10000; // Maximum value (variable product)
$args['min_value'] = 500;
$args['input_value'] = 500;
}
return $args;
}
Code goes in functions.php file of your active child theme (or active theme). Tested and works.