• Resolved jandelay

    (@jandelay)


    Hello,

    if i have a quantity step of lets say 2 and the user types in by hand, some other step that is not within the steps. I get the default “Step validation error message”

    Which is: “Please enter a valid value. The two nearest valid values are [should_min] and [should_next]”

    How can i deactivate the step validation?

    I want the customer to be able to buy whatever amount he types in, as long as it is higher then the min quantity.

    Example. If i have a Min. Quantity of 1000 and a Quantity Step of 500.

    I want the customer to still be able to type in by hand 1700. Without getting the step validation error.

    Thank you in advance.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor Md. Ibrahim Khalil

    (@mdibrahimk48)

    Hi,

    If you set step quantity – the manual input from the user must need to match the step as follow. Otherwise, it won’t work or is not logical for step quantity.

    Regards,
    Ibrahim
    Support Staff
    CodeAstrology

    Thread Starter jandelay

    (@jandelay)

    I found the function that is responsible to check this. Its the function wcmmq_qty_validation_by_step_modulous

    in /includes/set_max_min_quantity


    I already customized it to ignore the steps.

    However, the same validation applies in the Cart. I already searched everywhere, i cant find the function for the Cart. Are you able to tell me which function validates it for the Cart?


    Thank you in advance

    Plugin Author Saiful Islam

    (@codersaiful)

    use following code:

    add_filter('wcmmq_modulous_validation','__return_true');

    Plugin Contributor Md. Ibrahim Khalil

    (@mdibrahimk48)

    Hello @jandelay,

    If you want to ignore the steps for manual input without getting the step validation error you can use:

    add_filter(‘wcmmq_modulous_validation’,’__return_true’);

    ======================================
    add this code to your snippets. It will give you the result that you want.

    Regards,
    Ibrahim
    CodeAstrology

    Thread Starter jandelay

    (@jandelay)

    First of all, thank you for the answer.

    But where do i add this code? I tried replacing it with the already existing filter, but its doesnt work.

    Thank you in advance

    Plugin Contributor Md. Ibrahim Khalil

    (@mdibrahimk48)

    Hello @jandelay,

    You can use the snippets plugin to add this code.
    After installation: Add this code here – ( https://prnt.sc/r3gRxHXWLBYz )
    Then save and activate this snippet – ( https://prnt.sc/MgCk3XTYvsIk )

    And check. This filter will work.

    Regards,
    Ibrahim
    CodeAstrology

    Thread Starter jandelay

    (@jandelay)

    Thanks again.

    But that solution only works for the validation when clicking the “add to cart” button on the Product page.
    I already had that fixxed. That is not a problem anymore.

    My problem is that the same error appears, when someone tries to change the value of quantity within the Cart.

    Here is an image of what i mean: https://prnt.sc/TyFnErEcKjIe

    The code snippet that you provided only works on the product page, but not on the cart quantity validation 🙁

    Plugin Contributor Md. Ibrahim Khalil

    (@mdibrahimk48)

    Hello @jandelay,

    I found your issue. After fixing this issue I will notify you as soon as possible.

    Regards,
    Ibrahim
    CodeAstrology

    Thread Starter jandelay

    (@jandelay)

    Ok, thanks 🙂

    Thread Starter jandelay

    (@jandelay)

    Maybe got any update on this one? 🙂

    Thread Starter jandelay

    (@jandelay)

    any update? 🙂

    Thread Starter jandelay

    (@jandelay)

    Anybody looked into this yet? 🙁

    Plugin Contributor Md. Ibrahim Khalil

    (@mdibrahimk48)

    Hello,

    This comes from HTML validation. You can try it with JavaScript code or can avoid step – as usual you want manual input from users.

    Regards,
    Ibrahim
    CodeAstrology

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Deactivate step validation?’ is closed to new replies.