Hello,
Just wondering if there is a way to add the PayPal transaction calculation.
In Australia it is 2.4% of the total amount plus $0.30 AUD.
Is there a way to have this calculation added into the gravity form?
Thanks!
Hello,
Just wondering if there is a way to add the PayPal transaction calculation.
In Australia it is 2.4% of the total amount plus $0.30 AUD.
Is there a way to have this calculation added into the gravity form?
Thanks!
Hi Sophie,
With the latest version of Gravity Forms (not publicly released but I can send you and anyone else who requires this functionality privately) we've added two hooks that will let you add a surcharge much more readily.
Here is some sample code to get you started. http://pastie.org/2094896
Paste this in your theme's functions.php file.
This example simply adds $1.32 to the total. With a little math you can update the equation to add your flat fee + percentage.
Great, thank you very much for that.
I have upgraded but I don't seem to see where I then are able to do the equation.
Do I still need to paste the php code? and if I needed it to be 2.4% of the total cost of the transaction + 0.30 AUD where/what code do I enter? I'm not very good at php.
Thanks again :)
The code would go in your themes functions.php file.
You would need to know some PHP and jQuery to be able to do the equation. In the code snippet David provided you will see that it is taking the Total and adding 1.32 to it.
Here is a revised code snippet that adds the 2.4 percentage and the .30 transaction fee.
Greatly appreciated. I'll let you know how I go!
I've put the code in and tested the form but it doesn't seem to be working, unless I've missed something?
Where did you implement the code? Did you place it in your themes functions.php file?
Also make sure you are in fact running the latest version of Gravity Forms which is v1.5.2.8. It is currently available via automatic update.
The code went in to the functions.php file which I edited via ftp and the latest version of Gravity Forms was also uploaded via ftp.
I'm not sure what to say other than to make sure you made the appropriate changes to the code. There are 2 places you need to set the form id for the form you want this custom code to apply to.
Make sure you changed the form id in both the gform_pre_render filter and the gform_product_info filter, it's in 2 places.
I just tested the code that we provided to you on my test site and it works fine. So there isn't a problem with the code itself.
I went into the functions.php file and adjusted the settings 'gform_pre_render_57' to 'gform_pre_render_5' (because the id of the form is 5) and then the same to 'gform_product_info_57' to gform_product_info_5
That was a little confusing, but now it is working. Thanks for the help.
Good to hear Sophie! Glad you got it worked out.