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.

Dynamic Pricing | Word Count

  1. Hi, I've been using GF for a while now and am hoping to do a quite basic classifieds styled form, I've looked on the forums and have seen one or two mentions that it might be possible but can't see a solution, maybe someone can point me in right direction. In essence it would be a form with general information on it (name, contact details etc.) then the complicated bit with four fields that would all go towards making a price:

    1. The text of a classified (which would need to be word count based), i.e. first 16 words are £6.89 and each additional word is 9p
    2. A drop down menu option for a border or not (extra charge depending on which option chosen)
    3. Additional artwork checkbox which has eight options (and choosing one adds an additional fee)
    4. A photo upload option, if a photo was uploaded it would then add £3.20 onto the price

    Anyone know a) if this is doable with GF and b) if there's documentation or would it require custom work? Thanks in advance

    Posted 11 years ago on Wednesday June 27, 2012 | Permalink
  2. David Peralty

    1. We don't have word count built-in, only character count. If you want word count, you will have to come up with custom code in both the JavaScript and PHP side to do this.

    2. This is possible using our pricing fields. You can add an option to a product that is related to border or not and give it a price.

    3. You should be able to do this as well using the options field for a product.

    4. You can add a photo upload field. You would want to create a checkbox that is an option to change the price, and then using conditional logic, display the upload field if they check off that box.

    You would want to look at the following hooks and information:
    http://www.gravityhelp.com/documentation/page/Product
    http://www.gravityhelp.com/documentation/page/Option
    http://www.gravityhelp.com/documentation/page/Enable_Conditional_Logic

    Posted 11 years ago on Wednesday June 27, 2012 | Permalink
  3. David, thanks for that. As I kinda expected – three quite simple explanations and one with a bit of work!! So if I sorted out some custom code for word count rather than character, how would I then create the price based on that?
    And one other question (sorry for the newbie stuff if this is covered elsewhere). If all four of these need to work together to create one price, I take it that's doable?

    Posted 11 years ago on Friday June 29, 2012 | Permalink
  4. David Peralty

    You would probably have to create some kind of JavaScript code to add a price to a field. JavaScript isn't something I'm strong with, but ideally, you would calculate your value and put it in an input field so that it can be easily calculated with the rest of the objects in the form.

    You can use a number field and calculations to add up a product with two/three options and then the values of your other two fields to get a total price.

    Posted 11 years ago on Friday June 29, 2012 | Permalink
  5. Thanks for your help David

    Posted 11 years ago on Monday July 9, 2012 | Permalink
  6. David Peralty

    No problem. Let us know if anything else comes up.

    Posted 11 years ago on Monday July 9, 2012 | Permalink

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