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.

Help Adding Tax to Total

  1. Fika
    Member

    Hi,

    I have built a customer quote form using GF and I want to show the tax calculation at the end of some forms where tax is applicable. For example

    Sub-Total: $100
    Tax (20%): $20
    Total: $120

    I am trying to follow the support you give here http://www.gravityhelp.com/documentation/page/Gravity_Forms_Pricing:_Adding_Tax
    but I can't seem to understand correctly where the code should go.

    My form is purely for giving quotes and is not intended to be hooked up with Paypal etc, so therefore I need to calculate the tax in here as above.

    Any help? Thanks

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  2. David Peralty

    The code should go in your functions.php file. http://codex.wordpress.org/Theme_Development (see: Functions File).

    Let me know if you need any more details.

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  3. Fika
    Member

    Hi David,

    Thanks for the help. Can you provide me with a few more details?

    There are 2 pieces of code to be inserted. Frontend and Backend.

    I assume the frontend piece from that link goes to the functions.php, but what about the backend? Same place, or somewhere else?

    Also will this all give the desired affect of

    Sub-Total: $100
    Tax (20%): $20
    Total: $120

    Thanks

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  4. Fika
    Member

    Hi,

    I actually took a gamble and pasted both pieces of code into the functions.php and it seems to have worked. However, the form now just calculates the tax into the total and you don't understand that as a customer.

    Is there a way I can have two text fields above the total field (which includes tax) giving the breakdown?

    Sub-Total: $100
    Tax (20%): $20
    Total: $120

    Also a 2nd question. if I want to apply this code to multiple forms of choice do I just add multiple id's to the code such as

    add_filter('gform_product_info_9', 'gform_product_info_17', 'gform_product_info_31', 'update_product_info', 10, 3);

    Thanks in advance.....

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  5. David Peralty

    They both go into the functions.php file.

    And it should work as you've laid out, but it might require some customization that goes beyond the support I can provide here.

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  6. Fika
    Member

    Hey Dave,

    I have it working as described, but without the UI showing the breakdown. Do you think this should be working like I have laid out or is it a further customization?

    If so, do you have any tips on where to start looking or how to do it?

    Adding tax to pricing fields must be a common question, do you know of anyone else who has implemented it?

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  7. The new calculations functions in the beta would solve for this I'm sure if you wanted to try to play around with it.

    You can always post on the job board as well.

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  8. Fika
    Member

    Hi Rob,

    Thanks for the input. Dave just pointed the beta out on another thread, sounds great.

    Do you have any indication how soon the official release will be ready? Is it a matter of weeks or months? I could give the beta a try, just not sure how buggy it is or will it screw up any of my current forms I am using.

    Thanks

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  9. Fika
    Member

    Hi Rob,

    My comment on the beta is awaiting moderation so posting up my results of using the beta here as I can't seem to calculate the tax this way either.

    Using the beta release, I added a number field above my total in the form and enabled the calculation. A few issues I am noticing

    * Should the Total Field be in the Merge Tag drop down list? I can't seem to pick that total field which is what I need to calculate my 25% tax amount (=Total / 5)

    * The field on the frontend when the form is published has a dropdown arrow beside it. I would obviously only need this field for information purposes and not for the user to interact with via a dropdown. Is a dropdown the only supported field to make calculations in? The number field that is.

    So maybe you can help support based on this? Not sure if you seen it another way to make this calculation? but all I want to do is to divide my total by 5.

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  10. We are currently messing around with this ourselves over here. Will update once I have something concrete. Any chance you can post a link to your form that you are working on?

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  11. Fika
    Member

    Hi Rob, I am actually working both locally and on a dev so can't really post a link. I just posted some feedback in the support forums on the beta which might help

    Posted 12 years ago on Thursday April 19, 2012 | Permalink
  12. Fika
    Member

    Hi There,

    Any luck on figuring this out?

    Posted 12 years ago on Friday April 20, 2012 | Permalink
  13. We're making some tweaks to the product pricing fields merge tags to potentially get this working. Will update as soon as I have it.

    Posted 12 years ago on Friday April 20, 2012 | Permalink
  14. Hi Rob,

    I am also looking forward to a better way to make these calculations work in GF.
    Hope the update will be available soon, wish you all the best with tweaking.

    Posted 12 years ago on Friday April 20, 2012 | Permalink