• Resolved snakeip

    (@snakeip)


    Hi, I’m a premium customer.

    I was using this snippet to change default quantities for certain products and its variations (in this case 5 and 10):

    /**
    * Adjust the quantity input values
    */

    add_filter( ‘woocommerce_quantity_input_args’, ‘jk_woocommerce_quantity_input_args’, 10, 2 ); // Simple products

    function jk_woocommerce_quantity_input_args( $args, $product ) {
    if (( is_singular( ‘product’ ) && has_term( array( ‘128’ , ‘129’ , ‘153’ ), ‘product_cat’ ) && !is_single( array( ‘1871’, ‘298’ ) ) ) ) {
    $args[‘input_value’] = 10; // Starting value (we only want to affect product pages, not cart)
    }
    elseif (( is_singular( ‘product’ ) && is_single( array( ‘298’ ) ) ) ) {
    $args[‘input_value’] = 5; // Starting value (we only want to affect product pages, not cart)
    }
    $args[‘max_value’] = 9999; // Maximum value
    $args[‘min_value’] = 1; // Minimum value
    $args[‘step’] = 1; // Quantity steps
    return $args;
    }

    It worked flawlessy until few days ago, for variations too.

    Now the default quantities are always 1 (so the snippet isn’t working).

    If I deactivate your plugin it works again and the default quantities are changed correctly for certain products.

    There is need to update the plugin?

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Problem with default quantities’ is closed to new replies.