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.

Example Form in XML that calculates total!

  1. dickitt
    Member

    Hello, if anyone could help me by uploading an example of a gravity form that calculates the total and displays it at the end of the forum by adding a product that has 3 options in it and a fixed shipping cost. i cannot realize this, please!!

    Posted 13 years ago on Wednesday October 12, 2011 | Permalink
  2. Sure. I've created you a quick sample order form that has a Product, 3 Options and a Fixed Shipping Cost along with a Total field. It took me 5 minutes to throw together. You can download it here:

    http://dl.dropbox.com/u/185347/example-order-form-2.xml

    You can see a screenshot of what the form looks like here: http://i.imgur.com/M8Cn6.png

    Download and import the XML file by going to Import/Export under Forms and then selecting Import Forms. It will create a form called "Gravity Forms T-Shirt Order Form 2".

    Here is what it consists of:

    The "Name" and "Email" fields are self explanatory. No options were selected I simply added them to the form.

    The "Gravity Forms T-Shirt" field is a Product Field set to field type Single Product with Quantity disabled and a price of $19.99.

    The "Quantity" field is a Quantity field set to a field type of user input and a default value set to 1.

    The "Select A Design" field is an Option field set to a field type of drop down with 3 choices added each with a price of $0.00 which means they don't impact the price. To impact the price you would do like +$5.00 to add $5 or -$5.00 to make it $5 cheaper.

    The "Select A Size" field is an Option field set to a field type of drop down with 4 choices added. 3 of the choies have a price of $0.00 so they don't impact the price and the 4th choice has a price of +$5.00 so it increases the price by $5.

    The "Select A Color" field is an Option field set to a field type of drop down with 4 choices added. 3 of the choices have a price of $0.00 so they don't impact the price and the 4th choice has a price of +$10.00 so it increases the price by $10.

    All 3 Option Fields are automatically tied to the "Gravity Forms T-Shirt" field by virtue of it being the only Product field on the form. If you had multiple Product fields then you would select which Product field the Option field is associated with when editing that Option field. Option fields require a Product. You can't have a Size without a T-Shirt.

    The "Shipping" field is a Shipping field set to a field type of Single Method and a price set to $9.99.

    The "Total" field is simply a Total field with no additional options configured.

    Posted 13 years ago on Wednesday October 12, 2011 | Permalink
  3. I just realized you created 2 requests for the same issue. In the future please do not open up multiple requests for the same question.

    Posted 13 years ago on Wednesday October 12, 2011 | Permalink
  4. Gaslight
    Member

    Hi Carl,

    I'm not sure if this can be done or not:

    is there any way to get a variable consisting of the total price of an individual product + its related options, NOT the total price given by all products and their options altogether?

    for example

    product A has base cost of 10 USD
    there are 2 options +2 USD and +5 USD

    product B has base cost of 15 USD
    there are 2 options -3 USD and +2 USD

    suppose user selects product A and add option +2 USD, then selects product B without selecting options

    total price of product A is 12 USD (base 10 + 2 USD options)
    total price of product B is 15 USD (no options)

    total cost of all products is 27 USD

    can I extract dynamically all these values (individual totals and grand total)?

    thanks!

    Posted 13 years ago on Monday November 14, 2011 | Permalink