• Resolved deathbybots

    (@deathbybots)


    Hello,

    I would like to request a feature be added to the free version on this plug in. I need to have the default quantity of this plugin to only allow the quantity of the the quote to be defaulted to allow one.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,
    the free version of plugin haven’t this feature.
    You can try add this code in the file functions pf your theme:

    // Quantity in the cart Simple products 
    add_filter( 'woocommerce_quantity_input_args', 'custom_woocommerce_quantity_input_args', 10, 2 );
    
    function custom_woocommerce_quantity_input_args( $args, $product ) { 
    if ( is_singular( 'product' ) ) { 
    $args['input_value'] = 1;	// Starting value (we only want to affect product pages, not cart) 
    } 
    $args['max_value'] = 1; // Maximum value 
    $args['min_value'] = 1; // Minimum value 
    $args['step'] = 1; // Quantity steps 
    return $args; 
    }
    
    // Variations 
    add_filter( 'woocommerce_available_variation', 'custom_woocommerce_available_variation' );
    
    function custom_woocommerce_available_variation( $args ) { 
    $args['max_qty'] = 1; // Maximum value (variations) 
    $args['min_qty'] = 1; // Minimum value (variations) 
    return $args; 
    }
    Thread Starter deathbybots

    (@deathbybots)

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Request Feature: Default Quality’ is closed to new replies.