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.

Pricing fields section showing options: Product, Quantity, Option, Shipping, Total

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

Product sales field setup with user-defined price and validation rules options

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:

Entries Fields list with settings icons, highlights Net Sales and Gross Income as custom content

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

Pricing fields calculation using GravityView math for Product and Labor Sales with custom label, "Net Sales."

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

Custom content settings with math formula for calculating gross income using product, labor sales, and cost of goods

Here's our View so far:

Pricing fields table for 2019 shows monthly sales, cost of goods, and gross income calculations

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

Pricing calculation settings for adding field calculations to table footer with custom label and calculation optionsWe apply the same logic for all three Product fields in our View and voilá:

Table of 2019 monthly sales, costs, and income totals for product and labor categories, with annual 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:

Add field calculations with custom type and math shortcode in settings

And here's our final View:

Table listing 2019 monthly product sales, labor sales, net sales, cost of goods, and gross income totals

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