I had this code that i put n my theme finctions.
Recently i had to update so I pasted the code again but my site says
Parse error: syntax error, unexpected '}' in .......functions.php on line 94
the code:
http://pastebin.com/NGZTjcXb
I had this code that i put n my theme finctions.
Recently i had to update so I pasted the code again but my site says
Parse error: syntax error, unexpected '}' in .......functions.php on line 94
the code:
http://pastebin.com/NGZTjcXb
Try this out - http://pastebin.com/x0q6QjVF
Thanks. That got rid of the error
However, When I // update the '9' to the ID of my form for the surcharge, the form says Oops we cannot locate your form. When i change it to another number, the form comes out fine.
Also the "City" is not changing to "Suburb and "Zip" is not changing to just "Post Code"
Can you post a link to your form?
http://www.meff.ifew.com/stall-hire/apply-online/
Do you want me to remove the surcharge so you can see the form?
I have removed the Surcharge since people need to use the form
With the new calculations ability on number and product fields, you don't need to write PHP to do surcharges anymore. All you need to do is create a new Product Field and set it to be a Calculation Type. Then use the merge tags available to add up all of the products and then multiply them by a percentage.
Ok, Thank you!
What about the changing city to suburb and zip to post code?
Is there a way to do the calculation for the total?
The Total already adds up all the product fields that are selected (including the new calculated product).
i mean if the paypal option is selected, do total x 2.6/100 and add the amount to the total.
i mean if the paypal option is selected, do total x 2.6/100 and add the amount to the total.I want to do it like:
User selects Paypal. Form then calculates the Total + (2.6% of the total). How would I do that?
Right now the Total field isn't supported. So what you would need to do is make the new product calculation field add up all of the product fields above it, then get the 2.6 of that added together. Then that % and the selected products will be added together and the total will include the two.
Thanks! Works great. What about changing city to suburb and zip to post code?
Awesome!
Can you post your up-to-date functions file? I assume you got rid of the "surcharge" PHP and JS piece?
Hey Ruby,
Add these to your PHP
// CHANGE TO Post Code
add_filter("gform_address_zip", "change_address_zip", 10, 2);
function change_address_zip($label, $form_id){
return "Post Code";
}
// CHANGE TO State
add_filter("gform_address_state", "change_address_state", 10, 2);
function change_address_state($label, $form_id){
return "State";
}