Post

Add a surcharge fee to Gravity Forms transactions

One thing I love about gravity forms is You can use gravity forms for some basic e-commerce functions. It’s a great option if you just need to take a simple payment or have a simple product list and woocommerce would be overkill.

But what if you needed to add a surcharge? Which is a common E-commerce function. If using woo we would probably just get a free plugin to do this for us.

How can we do this with gravity forms E-commerce?

Add a 0.25% surcharge to the transaction

Add a surcharge to form with one product value

  • add a product field and set it to be of the calculation field type.
  • add the following code to the product calculation field
1
0.0025 * {Payment Amount:2}

Add Surcharge to a Form with Multiple Products Surcharge

  • multiply all the product price fields by their respective quantity fields
  • add them all together
  • wrap that calculation in ();
  • multiple by 0.0025
1
2
3
4
5
6
7
8
(
{fieldname (Price):1.2}*{fieldname (Quantity):1.3} +
{fieldname (Price):6.2}*{fieldname (Quantity):6.3} +
{fieldname (Price):8.2}*{fieldname (Quantity):8.3} +
{fieldname (Price):7.2}*{fieldname (Quantity):7.3} +
{fieldname (Price):9.2}*{fieldname (Quantity):9.3} +
{fieldname (Price):10.2}*{fieldname (Quantity):10.3}
)*0.0025
This post is licensed under CC BY 4.0 by the author.