Pricing fields calculation
This functionality requires the GravityMath plugin version 2.0 to be installed and activated on your website.
If your form has Pricing fields, it's now possible to perform calculations with them on your View.
In our sample form, we've added 3 Product fields set up as "User Defined Price" in order to collect pricing information:
In our View, besides two normal fields from the form (Year and Month) and the three pricing fields (Product Sales, Labor Sales, and Costs of Goods Sold), we'll be adding two additional Custom Content fields in order to calculate some totals using the [gravitymath] shortcode:
Here's the shortcode formula for the Net Sales column:
And here's the shortcode formula for the Gross Income column:
Here's our View so far:
Now, we'll be using the new "Table Footer Calculation" functionality from the Math extension to get totals for each column in our View:
We apply the same logic for all three Product fields in our View and voilá:
We can also add these footer calculations to Custom Content fields (Net Sales and Gross Income columns), we just need to specify "Custom" for the type of calculation and write the [gravitymath] shortcode formula we want:
And here's our final View:
Areas highlighted in Green were achieved using Table Footer Calculations, and areas highlighted in Red were achieved with the [gravitymath] shortcode.