Quantcast
Channel: Snippets Archives - Gravity Wiz
Viewing all articles
Browse latest Browse all 196

Subtotal Merge Tag (for Calculations)

$
0
0
View this code snippet on GitHub.

Currently, there is no easy way to get the current total (let’s call it the subtotal) of the form for use in calculations. It’s possible but you’ll have to enter all of your product merge tags into a long and complicated formula to get the subtotal.

This snippet helps you avoid that hassle by providing a {subtotal} merge tag for use in your Gravity Form calculations.

Please note: The {subtotal} merge tag is only available in for fields that support calculations.

How do I install this snippet?

Easy peasy. Just copy and paste the code above into your theme's functions.php file.

How do I use this functionality?

This snippet will add a new “Subtotal” merge tag to the merge tag select available for the “Formula” setting on Calculation fields. Selecting this option will insert the {subtotal} merge tag into your “Formula” setting. You can then use all available mathematical operations available to this field to manipulate this subtotal as needed.

formula-subtotal-merge-tagFormula Setting: Subtotal Merge Tag
formula-subtotal-taxFormula Setting: Subtotal Used to Calculate Tax

Viewing all articles
Browse latest Browse all 196

Latest Images

Trending Articles



Latest Images