PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How to create a subtotal for certain products

  1. Hi, I have a booking form with multiple products and I would like to create various sub-totals that only add up some of these products at a time, eg camping, equipment, site and conference fees. Can you tell me how I would do that?

    The form can be seen at http://www.newlifechurches.co.uk/booking/. There is no add-on being used and no payment being taken. It is just to allow people to submit a booking form and I've kept it simple by using a product for each booking option.

    I've seen calculation fields mentioned in the forums but can't find documentation on how to use them.

    Thanks,
    Paul

    Posted 11 years ago on Wednesday January 2, 2013 | Permalink
  2. I'm not certain if there is an official documentation page for calculations, but you can read about them here: http://www.gravityhelp.com/gravity-forms-v1-6-4-released/

    Calculations are available for product type fields and number type fields.

    Does that help?

    Posted 11 years ago on Wednesday January 2, 2013 | Permalink
  3. Thanks but those release notes don't say whether it is possible to create a subtotal of products using the calculation field. For example how would I use the number or product field to add up the total from a selection of other product fields used in the form?

    eg Product A £10, quantity selected 1
    Product B £15, quantity selected 2

    I now need a subtotal which shows the total cost of product A and product B including quantity which should show £40.

    Posted 11 years ago on Wednesday January 2, 2013 | Permalink
  4. Take a look at this screenshot: http://minus.com/lbe5NCYavOVYe3

    You can download the code for that form here: http://pastebin.com/sKW3bjiv (use the raw or download link, save the file with an xml extension on your computer, then import that into your WordPress site.)

    Take a look at the calculation formula for the two subtotal fields and see if that makes any more sense.

    Posted 11 years ago on Wednesday January 2, 2013 | Permalink