• Resolved mawo1985

    (@mawo1985)


    Hi there,
    I need your help….trying to add some rules as follows:

    Usually if you type in a number which is less than 86 (data-parsley-min=”86″) you will get an error message & the add to cart button is not activated till the error is fixed

    https://free-picload.com/image/qsh5FN

    How to add a similar rule (dynamic text is shown till condition is true)

    An Example:
    if Field [A] – Field [B] is less 30 show the error message & deactivate add to cart button

    if Field [A] – Field [B] is equal or greater 30 activate add to cart button

    https://free-picload.com/image/qshSdF

    Is there any way to add this logic? Maybe with data-parsley-message?
    THX

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author moomooagency

    (@moomooagency)

    Hi,

    It is possible to do this by using NOV. So, the result of your mini formula will be stored in it. Since NOVs are being evaluated, this method is quite restricted as there must be an ajax request to the backend to get variables values.

    Maybe you can do it like this for now, but then, when this functionality will be available in Builderius plugin (if you are not aware of it, then please join our fb group Builderius community to know more) you will reconfigure this part. Because it will work completely in the front end then.

    Thread Starter mawo1985

    (@mawo1985)

    Hi,
    yes I already did this kind of mini formula in NOV.
    If the result of this mini formula is < 30 a warning text is displayed at frontend.

    If the warning text is displayed customer should not be able to click “add to cart button”. Only if the result of mini formula is greater than 30 the customer should be able to add it to the cart.

    This function works when I use data-parsley-min but I want to use it for customized warning text.

    Another option would be if I can add this customized warning text with conditional logic with some kind of “data-parsley-message”.
    Is there any way (similar to data-parsley-min=”xxx”) for free text?

    Like: data-parsley-message=”this is a warning text because mini formula is < 30″

    Plugin Author moomooagency

    (@moomooagency)

    Yes, it is possible to use custom validation message. Example of usage: https://parsleyjs.org/doc/index.html#custom-messages

    Thread Starter mawo1985

    (@mawo1985)

    Great!
    I will try it.
    Many Thanks for your frequent support!

    Thread Starter mawo1985

    (@mawo1985)

    Good morning,
    tried different ways now but without any result. May you can give me a hint how I can fix this issue I am faced since one week now.

    I am trying to add one more query to Validation rule but seems like I do some mistake with dataparsley.

    Please take a look on to my screenshot.

    https://free-picload.com/image/qswqWS

    Plugin Author moomooagency

    (@moomooagency)

    You built your rule based on NOV which is being evaluated on backend after the ajax request. But you do not send ajax request, so NOV is not being evaluated, so your rule does not work.

    Thread Starter mawo1985

    (@mawo1985)

    Ok, sounds not that easy to fix it (for ma as a non programmer)
    May I find the solution on your web-page:

    https://moomoo-agency.gitbook.io/uni-cpo-4-documentation/for-developers/actions-filters

    Under Paragraph: “In the Cart”

    ?

    Thread Starter mawo1985

    (@mawo1985)

    @moomooagency may I can hire you for fixing this issue?
    Paying via PayPal of course

    Plugin Author moomooagency

    (@moomooagency)

    It cannot be fixed and it is not an issue in general. I mean, this is how it works. It was designed to work like this and simply cannot handle this case.

    If you want I can create a new form for you, that works completely in the front end yet customisable from backend. It is not related to Uni CPO though. If you are interested in, please, write to support@moomoo.agency

    Thread Starter mawo1985

    (@mawo1985)

    I have send you an Email to your support adress…Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Add to button validation logic’ is closed to new replies.