PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

theme functions problem

  1. 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

    Posted 12 years ago on Tuesday May 8, 2012 | Permalink
  2. Try this out - http://pastebin.com/x0q6QjVF

    Posted 12 years ago on Tuesday May 8, 2012 | Permalink
  3. 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"

    Posted 12 years ago on Tuesday May 8, 2012 | Permalink
  4. Can you post a link to your form?

    Posted 12 years ago on Tuesday May 8, 2012 | Permalink
  5. http://www.meff.ifew.com/stall-hire/apply-online/

    Do you want me to remove the surcharge so you can see the form?

    Posted 12 years ago on Wednesday May 9, 2012 | Permalink
  6. I have removed the Surcharge since people need to use the form

    Posted 12 years ago on Wednesday May 9, 2012 | Permalink
  7. 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.

    Posted 12 years ago on Wednesday May 9, 2012 | Permalink
  8. Ok, Thank you!

    What about the changing city to suburb and zip to post code?

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  9. Is there a way to do the calculation for the total?

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  10. The Total already adds up all the product fields that are selected (including the new calculated product).

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  11. i mean if the paypal option is selected, do total x 2.6/100 and add the amount to the total.

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  12. 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?

    Posted 11 years ago on Monday May 21, 2012 | Permalink
  13. 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.

    Posted 11 years ago on Monday May 21, 2012 | Permalink
  14. Thanks! Works great. What about changing city to suburb and zip to post code?

    Posted 11 years ago on Thursday May 24, 2012 | Permalink
  15. Awesome!

    Can you post your up-to-date functions file? I assume you got rid of the "surcharge" PHP and JS piece?

    Posted 11 years ago on Thursday May 24, 2012 | Permalink
  16. Bobby
    Member

    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";

    }

    Posted 11 years ago on Tuesday July 10, 2012 | Permalink