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.

Screenshot of the form editor showing the Pricing fields accordion highlighted

In our sample form, we've added 3 Product fields set up as "User Defined Price" in order to collect pricing information:

Screenshot of a form showing 3 product fields added to it

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:

Screenshot of the View editor showing all form fields added to the View plus two additional custom content fields

Here's the shortcode formula for the Net Sales column:

Screenshot of a custom content field with a [gv_math] shortcode inside

And here's the shortcode formula for the Gross Income column:

Screenshot of a custom content field with a [gv_math] shortcode inside

Here's our View so far:

Screenshot of our sample View

Now, we'll be using the new "Table Footer Calculation" functionality from the Math extension to get totals for each column in our View:

Screenshot of the field settings modal with the table footer calculations section highlighted in redWe apply the same logic for all three Product fields in our View and voilá:

Screenshot of the View showing column totals

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:

Screenshot of the table calculation footer section inside the field settings modal

And here's our final View:

Screenshot of the View with highlighted areas in red and green colors

Areas highlighted in Green were achieved using Table Footer Calculations, and areas highlighted in Red were achieved with the [gravitymath] shortcode.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us