Advertisement
adczk

Forminator - example discount based on number of repeater fields in group

Feb 13th, 2023
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.54 KB | None | 0 0
  1. {"type":"form","data":{"fields":[{"id":"group-1","element_id":"group-1","form_id":"wrapper-5530-9493","parent_group":"","type":"group","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-5530-9493","field_label":"Field Group","is_repeater":"true","min_limit":"1","max_limit":"10"},{"id":"number-1","element_id":"number-1","form_id":"wrapper-2971-5479","parent_group":"","type":"number","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-2971-5479","hidden_behavior":"zero","calculations":"true","limit_min":"1","limit_max":"150","field_label":"Price 1","placeholder":"E.g. 10","default_value":"50","description":"PUT ANY NUMBER HERE FOR TESTING it will be added as total price"},{"id":"number-2","element_id":"number-2","form_id":"wrapper-9458-5148","parent_group":"","type":"number","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-9458-5148","hidden_behavior":"zero","calculations":"true","limit_min":"1","limit_max":"150","field_label":"Price 2","placeholder":"E.g. 10","default_value":"50","formid":"wrapper-9458-5148","description":"Put any number here, it will be added as total price"},{"id":"calculation-2","element_id":"calculation-2","form_id":"wrapper-9245-1874","parent_group":"","type":"calculation","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-9245-1874","hidden_behavior":"zero","field_label":"Number of repeater fields submitted","formula":"{select-1-*}"},{"id":"select-1","element_id":"select-1","form_id":"wrapper-4532-9956","parent_group":"group-1","type":"select","options":[{"label":"Select","value":"Select","limit":"","default":"1","key":"4993-6109","error":"","calculation":"0"},{"label":"Option 1","value":"one","limit":"","key":"3950-2919","error":"","default":"","calculation":"1"},{"label":"Option 2","value":"two","limit":"","key":"1346-5107","error":"","default":"","calculation":"1"}],"cols":"12","conditions":[],"wrapper_id":"wrapper-4532-9956","hidden_behavior":"zero","value_type":"single","field_label":"Select","options_bulk_editor":"Select;Select; 1\nOption 1;one; 0\nOption 2;two; 0","calculations":"true"},{"id":"calculation-3","element_id":"calculation-3","form_id":"wrapper-2464-8311","parent_group":"","type":"calculation","options":[],"cols":"12","conditions":[{"element_id":"calculation-2","rule":"is_great","value":"3"},{"element_id":"calculation-2","rule":"is_less","value":"6"}],"wrapper_id":"wrapper-2464-8311","hidden_behavior":"zero","field_label":"Discount 3%","description":"if submitted 4 or 5 repeaters","formula":"0.03","condition_action":"show","hidden":""},{"id":"calculation-4","element_id":"calculation-4","form_id":"wrapper-6539-1996","parent_group":"","type":"calculation","options":[],"cols":"12","conditions":[{"element_id":"calculation-2","rule":"is_great","value":"5"}],"wrapper_id":"wrapper-6539-1996","hidden_behavior":"zero","field_label":"Discount 6%","description":"if submitted 6 or more repeaters","formula":"0.06","formid":"wrapper-6539-1996","hidden":""},{"id":"calculation-5","element_id":"calculation-5","form_id":"wrapper-7715-5638","parent_group":"","type":"calculation","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-7715-5638","hidden_behavior":"zero","field_label":"Discount applied","formula":"{calculation-3}+{calculation-4}"},{"id":"calculation-6","element_id":"calculation-6","form_id":"wrapper-9368-6038","parent_group":"","type":"calculation","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-9368-6038","hidden_behavior":"zero","field_label":"Total without discounts","formula":"{number-1}+{number-2}"},{"id":"calculation-1","element_id":"calculation-1","form_id":"wrapper-5496-2062","parent_group":"","type":"calculation","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-5496-2062","hidden_behavior":"zero","field_label":"Grand Total","formula":"{calculation-6}-({calculation-6}*{calculation-5})"}],"settings":{"pagination-header":"nav","paginationData":{"pagination-header-design":"show","pagination-header":"nav"},"formName":"Test","version":"1.23.0","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-hide","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":"test","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>","use_ajax_load":"1","print_value":"true","use_save_and_continue":"","cform-color-settings":"true","radio-border-static":"#74c100","use_donotcachepage":"1"},"client_id":null,"integration_conditions":[],"behaviors":[{"slug":"behavior-1234-4567","label":"","autoclose-time":"5","autoclose":"","newtab":"sametab","thankyou-message":"<p>Thank you for contacting us, we will be in touch shortly.</p>\n<p> </p>\n<p>{formatted_value}</p>","email-thankyou-message":"","manual-thankyou-message":"","submission-behaviour":"behaviour-thankyou","redirect-url":"","conditions":[{"element_id":"select-1","rule":"is","value":"one"}]}],"notifications":[]},"status":"publish","version":"1.23.0"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement