Public Ticket #3160543

dynamic rule minimal quantity but allow to lower

Closed
Comments
54 Tickets 22
qtwrk555 started the conversation 4 years ago on November 4, 2022 at 6:45pm

Hi,


I see in dynamic rule , you can set minimal quantity for certain product 


is there anyway I can make it be able to lower it ?


like I want to preset the minimal quantity to 10 , but allow user to go lower , like 5 quantity and purchase 


for now it seems when minimal quantity is applied , it disables the minus button 


best regards,

2,762
KingsPlugins replied 4 years ago on November 4, 2022 at 7:00pm

Hi there,


I understand that you'd like to change the default input quantity that's displayed (not the actual minimum though).


B2BKing doesn't have any features for this though unfortunately. 


If you'd like, I can share some basic code snippets, but these will work only in specific situations.


For example you can use:

add_filter( 'woocommerce_quantity_input_args', function($args, $product){
    if (!method_exists($product,'get_id')){
        return $args;
    }
    $args['input_value'] = 15;
    return $args;
    
}, 1000, 2);

This will set the default qty to 15 for all simple products on the product pages.


Kind regards,

Stefan

Sign In