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.

Using logic to calculate total

  1. Hi there,

    I've got a problem that I think should be solvable. My non-profit wants to calculate membership costs in pricing fields based on the user's response to two questions. But we don't want the user to see how this works behind the scenes, so we don't want any prices to appear before the total amount.

    Here are the 2 questions that determine cost:

    1. Please select the industry group that best describes your business*

    Commercial Products/Services
    Construction
    Consumer Products
    Education, Non-Profit & Government Entities
    Financial & Insurance Services
    Healthcare
    Information Technology
    Manufacturing
    Professional
    Transportation

    2. Number of employees in U.S.*

    1 – 750
    751 – 1,000
    1,001 – 1,500
    More than 1,500

    And here's the logic we want to implement:

    - IF the answer question 1 is "Education, non-profit & government," THEN total is $950.00

    - IF the answer to question 1 is NOT "Education, non-profit & government," AND answer to question 2 is...
    "1 – 750" then total is $950.00
    "751 – 1,000" then total is $1,875.00
    "1,001 – 1,500" then total is $3,125.00
    "More than 1,500" then total is $4,500.00

    Thanks in advance for your help!

    -Ben

    Posted 6 years ago on Friday December 28, 2012 | Permalink
  2. David Peralty
    Administrator

    So I would have four products that use conditional logic to show.

    The first product would be:
    $950 and the conditional logic would be - Show if Any of the following are true.
    - Question 1 = Education
    - Question 2 = 1 - 750

    The next ones would all be:
    Show if ALL of the following are true:
    Question 1 is no Education
    Question 2 = $$$

    I hope that helps.

    Posted 6 years ago on Friday December 28, 2012 | Permalink
  3. Thanks David, I appreciate your help. But now I'm having a related issue.

    That method works for me in the preview form, but not on my actual theme. The newly created conditional product fields are not appearing when the correct criteria are selected. This is weird because I have another conditional field elsewhere (file upload field) on this same form, and that one works just fine.

    Do you have any known issues with the Envision Theme from Themefuse?

    Thanks,
    Ben

    Posted 6 years ago on Friday December 28, 2012 | Permalink
  4. David Peralty
    Administrator

    I'm sorry, I don't have any knowledge or experience with that theme specifically. Are you able to link us to a page where we can see what's going on? Can you also test a simple Conditional logic thing with the product field to make sure it isn't a conditional logic issue, but instead, and more likely, a JavaScript issue?

    Posted 6 years ago on Friday December 28, 2012 | Permalink
  5. I wanted to follow-up on this, even though it has been 6 months since my first post and I am now using a different theme.

    I followed David's instructions regarding my use of conditional logic within my product fields and they were spot-on. The form works properly in Preview mode -- all four pricing options display based on the way a user answers those two questions I mentioned above.

    However, the pricing form does not work properly on my live site. For some odd reason, only the FIRST product field displays on my live site when the appropriate conditions are met in the 2 key fields. If I change the answers to those 2 key questions, I don't see any corresponding product fields at all.

    Does this make sense? I hope someone can help.

    You can view the problem here:
    https://www.minoritysupplier.org/membership/corporate-membership/apply-for-membership/

    Posted 5 years ago on Friday June 28, 2013 | Permalink
  6. If it works in the form builder preview window but not on the front-end, you'll want to first run through a theme/plugin conflict test:

    http://www.gravityhelp.com/documentation/page/Testing_for_a_Theme/Plugin_Conflict

    Posted 5 years ago on Friday June 28, 2013 | Permalink

This topic has been resolved and has been closed to new replies.