Answer the question
In order to leave comments, you need to log in
Changing the quantity of a Woocommerce item?
Hello.
There is code in functions.php:
if(get_field('wholesale', $post->ID)) {
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'] = 5; // Starting value (we only want to affect product pages, not cart)
}
$args['max_value'] = 100; // Maximum value
$args['min_value'] = 5; // Minimum value
$args['step'] = 1; // Quantity steps
return $args;
}
// Variations
add_filter( 'woocommerce_available_variation', 'jk_woocommerce_available_variation' );
function jk_woocommerce_available_variation( $args ) {
$args['max_qty'] = 100; // Maximum value (variations)
$args['min_qty'] = 5; // Minimum value (variations)
return $args;
}
}
Answer the question
In order to leave comments, you need to log in
There is. Use cURL .
upd. In fact, very few sites now can simply give away page content without context. At a minimum, they need all sorts of cookies, user agents, and so on. Theoretically, it is possible to pass the request context to file_get_content , but cURL handles this better and easier.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question