Quantity Validation Issue with Min Max Step Quantity Limits

Forums Min Max Default Quantity for WooCommerce Quantity Validation Issue with Min Max Step Quantity Limits

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #161127
    Alessio
    Participant

    Hello,

    I’m experiencing an issue with your plugin. I have a product configured as follows:

    Minimum quantity: 6
    Step: 6
    Stock available: 2

    As a result, the generated HTML input field is:

    <input type=”hidden” id=”…” class=”input-text qty text” name=”quantity” value=”2″ aria-label=”Product quantity” min=”2″ max=”2″ step=”6″ placeholder=”” inputmode=”numeric” autocomplete=”off”>

    The problem is that the plugin does not seem to handle this situation correctly:

    The quantity input field appears empty, and I cannot increase or decrease the value.
    Pressing “Add to Cart” adds 1 unit to the cart, ignoring the minimum and step settings.
    No error message appears (e.g., “Minimum 6” or “Invalid quantity”).
    In this case, the correct behavior should be making the product unpurchasable, since the stock is lower than the required minimum.

    Could you check this issue and provide a solution?

    Thanks for your support.

    Best regards,

    • This topic was modified 1 month, 2 weeks ago by Alessio.
    #161779
    Taha
    Moderator
    Plugin Support

    Hi Alessio,

    Thanks for reaching out! I hope you’re having a great day.

    I was able to replicate the same scenario on my end, and I believe you are correct. At the moment, the only available option is to hide the “Add to Cart” button when stock is below the minimum quantity. By default, the plugin still allows adding products to the cart even when the stock is below the set minimum quantity.

    If this solution works for you, you can enable it by navigating to the Minimum Quantity tab—this setting is located at the bottom of the options.

    That said, I have escalated this issue to our development team for further review, and we will update you as soon as possible.

    Please let me know if you need any further assistance. I’m happy to help!

    #162015
    Pablo
    Moderator
    Plugin Support

    Hi Alessio,

    Please check if setting the option General > Add to cart validation to Validate and Add notices might help.

    #162321
    Alessio
    Participant

    I tried the option you suggested, but it doesn’t work. Additionally, I noticed that if the minimum required quantity is 6 and the quantity step is 6, and the product has only 6 in stock, the input goes to <code data-start=”246″ data-end=”261″>type=”hidden” (in this case, it’s the input from a grouped product, with each child product having its own quantity input and add-to-cart button):

    <div class=”quantity”>
    <button type=”button” class=”plus”>+</button>
    <label class=”screen-reader-text” for=”quantity_67e69bb264ee2″>FILETTARE-LAMA FLEX 18 SUPRA quantity</label>
    <input type=”hidden” id=”quantity_67e69bb264ee2″ class=”input-text woosg-qty woosg_qty qty text” name=”woosg_qty_1″ value=”6″ aria-label=”Product quantity” min=”6″ max=”6″ step=”6″ placeholder=”” inputmode=”numeric” autocomplete=”off”>
    <button type=”button” class=”minus”>-</button>
    </div>
    <p class=”” data-start=”889″ data-end=”991″>If I click “Add to Cart,” it works, but I don’t see the quantity, because it goes to <code data-start=”974″ data-end=”990″>type=”hidden.”</p>

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.