• Resolved acrspf

    (@acrspf)


    I have a form which has a calculation field that displays two different values depending on whether it’s the front-end form or the email/pdf rendering. Undesired behavior.

    The way it works is we have a hidden field that is populated from a ACF custom field by an mu-plugin that Forminator tech support helped me set up – works great, thank ya’ll ?? – then there’s a “Total” field which takes that hidden field and adds it to the result of another calculation field. This works fine both frontend and in the email.
    Then I have a Processing Fee calculation field which takes the result of the Total field and multiples it by a set fraction 0.035. This works fine in the front end form, but in the email gives a completely erroneous result that looks like it’s taking it’s value from the original hidden field, ignoring the calculations in the middle.

    Total {calculation-6} = {hidden} + {calculation-5} *** correct in form/email

    Processing fee = {calculation-6} * 0.035 *** correct in form, wrong in email

    Given initial values of hidden and calculation-5 of 4200 and 500, the Total field = 4700 – correct, both on form and in email.

    And here’s the problem: on the form, the Processing Fee field gives the correct value = 164.50, BUT the email gives 4200, or the original {hidden} field value.

    This is consistent no matter what values are fed into it, it always displays the original {hidden} value and not the calculated value.

    Where to go from here? I’ve been over it and redid it several times, with the same result each time. Help. :()

    Thanks in advance ??

    • This topic was modified 1 year ago by acrspf.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter acrspf

    (@acrspf)

    I imagine it’s something dumb I’m doing on my part. But I can take this to the Pro forums if needed. Thanks.

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @acrspf,

    Trust you are doing good and thank you for reaching out to us.

    Could you please share an export of the form using pastebin.com or Google Drive so that we can take a closer look at the issue?

    I hope the following guide comes in handy: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export

    I imagine it’s something dumb I’m doing on my part. But I can take this to the Pro forums if needed. Thanks.

    Please feel free to open a support ticket with us if you are a pro member.

    Kind Regards,
    Nebu John

    Thread Starter acrspf

    (@acrspf)

    Here you are, Nebu, thank you!
    (just a side note, I did not get an email notification of this reply although usually do get them)

    https://drive.google.com/file/d/110deZkuheJy2bffgREKV8sg6LCB6tQZA/view?usp=sharing

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hello @acrspf,

    Thank you for sending the form. This seems to be happening due to the known issue, when a conditionally hidden field is used for calculations.

    In your form {calculation-5} field has the visibility condition, depending on {number-1} field’s value.

    Could you please check if removing this rule helps:

    https://prnt.sc/Q4izX5Elg6AS

    Since {calculation-5} field’s value is used for other calculations, it may lead to the cases when the calculated result is different in emails.

    Our developers are aware of the issue, and are looking to improve the way calculations work with visibility conditions, but we can’t currently provide ETA, I’m afraid.

    Hope this helps. Please let us know if there’s still any issue after removing the visibility rule for {calculation-5} field.

    Best Regards,
    Dmytro

    Thread Starter acrspf

    (@acrspf)

    Hi Dmytro;
    I removed the visibility rule, same result as before. No change.

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @acrspf

    Thank you for response!

    I just downloaded the form that you shared earlier and imported it to my test setup.

    Then I removed the visibility condition from the “calculation-5” field (as suggested by Dmytro) and submitted the form.

    I can say that the calculations there were correct for me and correctly included in e-mail. With the “calculation-6” result for my example data at 502.86, I got “calculation-1” (Processing Fee) result at 17.60 – and that was included properly in e-mail.

    So just to make sure – you mentioned PDF earlier too. PDFs are not included in form import so I didn’t check those but can you confirm that it’s still not working for you directly in e-mail notification or only in generated PDF now?

    Can you share the form export again with the changes that you already made to it, please?

    Kind regards,
    Adam

    Thread Starter acrspf

    (@acrspf)

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @acrspf,

    I’m not able to replicate such behaviour as shared in your screenshot when tested in my system with the given form export.

    Could you please test and see whether the calculations are correct on your side if you manually change the “Custom Value” for the “7-day rental fee” hidden field to a number? ie for example change “Custom value” to 4200 and then check whether you get the same calculation as you have shared in your previous screenshot or not.

    View post on imgur.com

    Either the mu-plugin is causing a conflict or there might be more than one custom code which might be causing a conflict.

    Could we know from which ticket URL you got the mu-plugin?

    Please do let us know how that goes.

    Looking forward to your response.

    Kind Regards,

    Nithin

    Thread Starter acrspf

    (@acrspf)

    I changed the hidden field to 4200 as you suggested, exact same result. Form on the front end is fine, the email is still putting 4200 in the Processing Fee field.

    However your comment about conflicts did get me thinking… a couple months ago when I was first struggling with this, I had used a snippets plugin to set up some calc field code. Then I got sick and didn’t get back to this for a few weeks, when i did I used the cpanel file manager to set up the code.
    There was a snippet in there that I didn’t think had anything to do with this, deactivated that, and the email started working properly again.

    So there was some kind of conflict going on there. I would not have found it without your help! Thanks!

    I think i can mark this one resolved at this point.


Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘ACF calculation showing different result in form and in email’ is closed to new replies.