• Resolved luisinho77

    (@luisinho77)


    Hi, how can I put the minimun value to buy a product on the quantity field by default??

    <input value=”_wc_mmax_min” min=”_wc_mmax_min” name=”quantity”>

    Thanks in advance

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Ashok G

    (@wpashokg)

    @luisinho77 I didn’t understand your question. can you give me an example ?

    Thread Starter luisinho77

    (@luisinho77)

    Yeah, of course and sorry form my english ??

    I have a product with a 10 minimun units to buy… but in the input[name=”quantity”], I get selected 1, and I can put 2, 3… when I’ll never could to buy minus than 10 units…

    If I try add to cart 5 units, then it show me a alert, but I can to limit to user than only can select 10 or more units to enter to any product.

    thank you!!

    Thread Starter luisinho77

    (@luisinho77)

    Ok, I see the problem… I don’t want to put maximun limit and thought that the way was to put 0 into backend input… and at save it, the system had return maximun = 1… minimum 10 and maximum 1… but it’s was that the product page don’t work propertly with the input field quantity… If I put minimun = 10 and maximun =30, it’s working fine but with maximun limit…

    How can I to put a product without maximum limit??

    Thanks in advance, Luis.

    Plugin Author Ashok G

    (@wpashokg)

    @luisinho77, this plugin requires maximum limit to be set to work properly.

    I don’t want to make it complex. And what you are asking cannot be solved by this plugin.

    If possible you can give the larger number.

    Also I’ll think how to map inventory with maximum value. But this’ll not happen immediately. Need some more time.

    Thread Starter luisinho77

    (@luisinho77)

    Ok, don’t worry, it’s a fantastic plugin and it resolved the initial problem, the other is easylly to solve.

    Thanks for your time and best regards, Luis.

    @luisinho77 You can do this by adding the following to your functions.php

    function dwd_input_default( $args, $product ) {
    	if ( is_singular( 'product' ) ) {
    		$args['input_value'] = 3;
    	}
        return $args;
    }
    add_filter( 'woocommerce_quantity_input_args', 'dwd_input_default', 10, 2 );
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Put miminum value on input quantity field’ is closed to new replies.