• Resolved InventiveWebDesign

    (@inventivewebdesign)


    I am using your awesome Field Groups to create a form similar to the one that you are showing on this page: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#example-field-group-setup. I just have one extra calculation step that isn’t fully working. Here’s the test form: https://energybalanceinitiative.com/form-test-page/

    Here’s where my form works:

    Go the to Course Registration section towards the bottom

    1. Select a Registration Option (Please select a registration option below)
      • If you select the third option ($120+ Instructor/Student(s) Group) the Field Group from your demo mentioned above appears
      • If you add a number to “How many students are you registering?” the Student Information fields show up and the calculation field works correctly (see Student(s) Cost and Total calculation fields below).

    Here’s where it doesn’t work:

    If the user selects either of the first Registration Options ($95 or $25) it is automatically adding $20 for 1 student to the cost from the calculations from the field group mentioned above. This happens even if the number of students is set to 0.

    Here is how my calculations work:

    1. The Registration Option radio buttons are each assigned a calculation value of $95, $25, & $100 (for the $120+ field) respectively.
    2. The Student(s) Cost calculation field that is set to be the number from “How many students are you registering?” x 20. Note that the “How many students…” field is only visible if you select the $120+ radio button because that is the only time it is applicable to the form.
    3. The Field “How many students are you registering?” is set to have a default value of 0 so any calculations before the user changes that field should be 0. You can see this working if you select the $120+ option. The Total field is $100 until you change that number of students and then if goes up $20 for each student added).
    4. The Total field is using this calculation: The value from #1 above (radio buttons with the values 95, 25, 100) + the value of #2 above (the Student(s) Cost calculation field) – any fields that offer coupon code discounts.

    My question is how can I get the Total field to not add $20 for the first two Registration Options.

    Is there a way to add conditions to a calculation? For example if option 3 from the Registration Option field is not selected ignore that Student(s) Cost field in the calculation?

    Is there another way to run the calculations better like moving the costs from the Registration Options radio buttons to another calculation field?

    Here is a screencast I put together showing my issues: https://app.screencastify.com/v3/watch/CYEaIRP9jzXOvXDSuovJ

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @inventivewebdesign

    I hope you are doing well.

    I can see the issue on your form but we will need to run some testing to verify the best approach to fix it, could you export the form https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export and share it using pastebin.com?

    Best Regards
    Patrick Freitas

    Thread Starter InventiveWebDesign

    (@inventivewebdesign)

    Thanks for the quick response. Here you go!

    https://pastebin.com/b9t0Tfg3

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @inventivewebdesign

    Thanks for sharing the form. I checked it and it’s quite complex so I’m not entirely sure if I understood it correctly. But assuming I did:

    – the “Student’s cost” calculation uses “number-1 * 20” calculation
    – so when the “number-1” field is visible, it’s whatever number is set there, times 20

    So far so good. But then if “number-1” field is hidden

    – the “number-1” field in “Calculations” settings has option set to “Ignore this field” when the field is hidden

    – so if this field is not visible, that calculation in “Student’s cost” ignores the “number-1” field and becomes just “20”.

    And here you have “extra 20”.

    If you change the “number-1” calculations option to “Null (zero)” instead, then the “Student’s cost” calculation with number-1 field hidden will become “0 * 20” and that equals 0 and not 20; “extra 20” would be gone.

    Best regards,
    Adam

    Thread Starter InventiveWebDesign

    (@inventivewebdesign)

    This sounds like it should work but you said “If you change the “number-1” calculations option to “Null (zero)” instead, then the “Student’s cost” calculation with number-1 field hidden will become “0 * 20” and that equals 0 and not 20; “extra 20” would be gone.”

    Where or how do I set this? If I look at the “number-1” field which is the “How many students are you registering?” field there is only the ability to enable or disable Calculations in the Calculations tab. I have the default value set to 0. Do I have to change that default value to “Null”?

    If I look into the Student’s Cost Calculation field I don’t see any options to to set it to Null. I also don’t see anything in either field to Ignore this field when hidden.

    I just have the free version of Forminator. Is this a setting that we would need to pro version for?

    Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @inventivewebdesign,

    I hope you are doing well today!

    You should be able to see it on the Calculations tab in Number field settings.
    https://prnt.sc/8So2us1aGg-x

    https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#calculations-tab

    Kind regards,
    Zafer

    Thread Starter InventiveWebDesign

    (@inventivewebdesign)

    I don’t have that option. The number-1 field is the question “How many students are you registering?”. When I go to the calculations tab I only have Enable/Disable.

    Thread Starter InventiveWebDesign

    (@inventivewebdesign)

    Nevermind, I updated the forminator plugin and it appeared. Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Forminator Field Group Calculations’ is closed to new replies.