I want to seek for help about my issue on woocommerce.

I have implemented the minimum order increment snippet from woocommerce.
now what I am trying to do is I want to only make this code work on specific product categories.

this is the working code from woocommerce that I am trying to customize:

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']    = 10;   // Starting value (we only want to affect product pages, not cart)

    $args['max_value']  = 1000;     // Maximum value
    $args['min_value']  = 10;       // Minimum value
    $args['step']       = 10;    // Quantity steps
    return $args;

// Variations
add_filter( 'woocommerce_available_variation', 'jk_woocommerce_available_variation' );

function jk_woocommerce_available_variation( $args ) {
    $args['max_qty'] = 1000;        // Maximum value (variations)
    $args['min_qty'] = 10;      // Minimum value (variations)
    return $args;

I already tried to customize it and add “is_product_category” in the code but still not working

Read more here: woocommerce apply function on a specific category


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: