Field Group repeater calculation help
-
Hi, I’m trying to understand the way calculations work in the field group repeater feature.
I only seem to be able to get the one calculation amount.
So if group 1 is $5 and group 2 is $15, I only get $5 coming through.
I’m not able to see the “-*” field to add to the calculation and not able to see or the ALL option outside of the group.
I have tried to use the logic in the Field Group tutorial on your website.
Any guidance on what I am doing wrong would be greatly appreciated.
My form is here.
https://drive.google.com/file/d/1WyNwJFxKzrHnwf8QPUk71oCKhqWhEXqI/view?usp=sharingThe page I need help with: [log in to see the link]
-
Resolved – changed how the calculations work to relate to number of selected items as a trigger.
Hi @motodan
I hope you are doing well today.
I’m glad you were able to find solution. Let us know if you will need more help.
Kind Regards,
KrisGood morning everyone,
TLDR: when using values from select fields within group field, values for second group item don”t calculate.
I have used the provided test form (https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#wildcard-merge-tags) trying to adapt it to my setup.
I have updated the calculation to: {select-1}*{number-1} (instead of {number-1}*{number-2}
The value is calculated correctly for the first donation. The second donation stays at 0$.
Am I doing something wrong or is this maybe a bug?
{"type":"form","data":{"fields":[{"id":"group-1","element_id":"group-1","form_id":"wrapper-7324-4903","parent_group":"","type":"group","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-7324-4903","field_label":"Your Information","is_repeater":"false"},{"id":"name-1","element_id":"name-1","form_id":"wrapper-3207-4004","parent_group":"group-1","type":"name","options":[],"cols":"6","conditions":[],"wrapper_id":"wrapper-3207-4004","field_label":"Name","placeholder":"E.g. John Doe","prefix_label":"Prefix","fname_label":"First Name","fname_placeholder":"E.g. John","mname_label":"Middle Name","mname_placeholder":"E.g. Smith","lname_label":"Last Name","lname_placeholder":"E.g. Doe","prefix":"true","fname":"true","mname":"true","lname":"true","required_message":"Name is required.","prefix_required_message":"Prefix is required.","fname_required_message":"First Name is required.","mname_required_message":"Middle Name is required.","lname_required_message":"Last Name is required.","layout_columns":"2","required":"1"},{"id":"email-1","element_id":"email-1","form_id":"wrapper-3207-4004","parent_group":"group-1","type":"email","options":[],"cols":"6","conditions":[],"wrapper_id":"wrapper-3207-4004","validation":"","placeholder":"E.g. [email protected]","field_label":"Email Address","required":"1"},{"id":"group-2","element_id":"group-2","form_id":"wrapper-7524-9012","parent_group":"","type":"group","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-7524-9012","field_label":"Donation Details","is_repeater":"true","max_limit":"3","min_limit":"1","min_limit_type":"custom","max_limit_type":"custom"},{"id":"select-1","element_id":"select-1","form_id":"wrapper-4198-3862","parent_group":"group-2","type":"select","options":[{"label":"Free Meal for a Child","value":"one","limit":"","key":"3660-2642","error":"","default":"1","calculation":"10"},{"label":"Medical Treatment","value":"two","limit":"","key":"4882-1920","error":"","default":"","calculation":"20"},{"label":"Feed a Homeless Person","value":"three","limit":"","default":"","key":"6926-4020","error":"","calculation":"30"}],"cols":"3","conditions":[],"wrapper_id":"wrapper-4198-3862","value_type":"single","field_label":"Cause","options_bulk_editor":"Free Meal for a Child;one; 1\nMedical Treatment;two; 0\nFeed a Homeless Person;three; 0","options_expanded":"1","calculations":"true"},{"id":"number-1","element_id":"number-1","form_id":"wrapper-4198-3862","parent_group":"group-2","type":"number","options":[],"cols":"3","conditions":[],"wrapper_id":"wrapper-4198-3862","calculations":"true","limit_min":"1","limit_max":"150","field_label":"No of People","placeholder":"E.g. 10","default_value":"0"},{"id":"number-2","element_id":"number-2","form_id":"wrapper-4198-3862","parent_group":"group-2","type":"number","options":[],"cols":"3","conditions":[],"wrapper_id":"wrapper-4198-3862","calculations":"true","limit_min":"1","limit_max":"150","field_label":"Donation Amount","placeholder":"E.g. 10","formid":"wrapper-4944-8997"},{"id":"html-1","element_id":"html-1","form_id":"wrapper-4198-3862","parent_group":"group-2","type":"html","options":[],"cols":"3","conditions":[],"wrapper_id":"wrapper-4198-3862","field_label":"Amt Donated","variations":"<p>${calculation-1}</p>"},{"id":"calculation-1","element_id":"calculation-1","form_id":"wrapper-3797-2686","parent_group":"group-2","type":"calculation","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-3797-2686","field_label":"Amt Donated Calc","formula":"{select-1}*{number-1}*{number-2}","hidden":"1"},{"id":"calculation-2","element_id":"calculation-2","form_id":"wrapper-2615-3228","parent_group":"","type":"calculation","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-2615-3228","field_label":"Total Amt Donated Calc","formula":"{calculation-1-*}","hidden":"1"},{"id":"html-2","element_id":"html-2","form_id":"wrapper-9968-4484","parent_group":"","type":"html","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-9968-4484","field_label":"Total Amt Donated","variations":"<p>${calculation-2}</p>"}],"settings":{"pagination-header":"nav","paginationData":{"pagination-header-design":"show","pagination-header":"nav"},"formName":"Donation Form","version":"1.22.1","form-border-style":"none","form-padding":"","form-border":"","fields-style":"open","validation":"on_submit","akismet-protection":"0","form-style":"default","enable-ajax":"true","autoclose":"true","submission-indicator":"show","indicator-label":"Submitting...","form-type":"default","submission-behaviour":"behaviour-thankyou","thankyou-message":"Thank you for contacting us, we will be in touch shortly.","submitData":{"custom-submit-text":"Send Message","custom-invalid-form-message":"Error: Your form is not valid, please fix the errors!"},"validation-inline":"1","form-expire":"no_expire","form-padding-top":"0","form-padding-right":"0","form-padding-bottom":"0","form-padding-left":"0","form-border-width":"0","form-border-radius":"0","cform-label-font-family":"Roboto","cform-label-custom-family":"","cform-label-font-size":"12","cform-label-font-weight":"bold","cform-title-font-family":"Roboto","cform-title-custom-family":"","cform-title-font-size":"45","cform-title-font-weight":"normal","cform-title-text-align":"left","cform-subtitle-font-family":"Roboto","cform-subtitle-custom-font":"","cform-subtitle-font-size":"18","cform-subtitle-font-weight":"normal","cform-subtitle-text-align":"left","cform-input-font-family":"Roboto","cform-input-custom-font":"","cform-input-font-size":"16","cform-input-font-weight":"normal","cform-radio-font-family":"Roboto","cform-radio-custom-font":"","cform-radio-font-size":"14","cform-radio-font-weight":"normal","cform-select-font-family":"Roboto","cform-select-custom-family":"","cform-select-font-size":"16","cform-select-font-weight":"normal","cform-multiselect-font-family":"Roboto","cform-multiselect-custom-font":"","cform-multiselect-font-size":"16","cform-multiselect-font-weight":"normal","cform-dropdown-font-family":"Roboto","cform-dropdown-custom-font":"","cform-dropdown-font-size":"16","cform-dropdown-font-weight":"normal","cform-calendar-font-family":"Roboto","cform-calendar-custom-font":"","cform-calendar-font-size":"13","cform-calendar-font-weight":"normal","cform-button-font-family":"Roboto","cform-button-custom-font":"","cform-button-font-size":"14","cform-button-font-weight":"500","cform-timeline-font-family":"Roboto","cform-timeline-custom-font":"","cform-timeline-font-size":"12","cform-timeline-font-weight":"normal","cform-pagination-font-family":"","cform-pagination-custom-font":"","cform-pagination-font-size":"16","cform-pagination-font-weight":"normal","payment_require_ssl":"","submission-file":"delete","store_submissions":"1","form_name":"donation-form","form_status":"publish","sc_email_link":"1","sc_message":"<p>Your form has been saved as draft and a resume link has been generated so you can return to the form anytime within {retention_period} days from today. Copy and save the link or enter your email address below to have the link sent to your mail.</p><p>These fields weren't saved to your submission draft: Paypal, Stripe, Signature, Password, Captcha, and Upload. Kindly fill them out before submitting the form.</p>"},"client_id":"","integration_conditions":[],"behaviors":[{"slug":"behavior-1234-4567","label":"","autoclose-time":"5","autoclose":"true","newtab":"sametab","thankyou-message":"<p>Thank you for your kind donation!</p>","email-thankyou-message":"","manual-thankyou-message":"","submission-behaviour":"behaviour-thankyou","redirect-url":""}],"notifications":[{"slug":"notification-1234-4567","label":"Admin Email","email-recipients":"default","recipients":"[email protected]","email-subject":"New Form Entry #{submission_id} for {form_name}","email-editor":"You have a new website form submission: <br /> {all_fields} <br />---<br /> This message was sent from {site_url}.","email-attachment":"true","type":"default","conditions":[]}]},"status":"publish","version":"1.22.1"}
-
This reply was modified 1 year, 12 months ago by
madeluxxe.
HI @madeluxxe
I hope you’re well today!
I understand that you are experiencing the same/similar issue but, as per this forum rules, please start a separate ticket of your own.
We will assist you there.
Best regards,
Adam -
This reply was modified 1 year, 12 months ago by
- The topic ‘Field Group repeater calculation help’ is closed to new replies.