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.

Complex calculations. Pricing table lookup

  1. I've a large ecommerce project is for a blinds manufacturer that requires some complex pricing so looking to use gravity forms and linked to woocommerce cart. A somewhat similar site and concept to what we need to do is
    http://www.tuiss.co.uk/roman-blinds/3861/essential-natural.htm

    Price calculations are quite convoluted. The pricing calculations are not a normal dimensional based around area though, but is more table based due to overlaps of materials etc. He has 6 pricing spreadsheets that will be assigned to the various product groups. Here's one
    https://www.dropbox.com/s/a2uz1i77uecnpyh/PRICE.xls

    If I have separate forms with length-width for each price group, but need the result to come from a fixed data above. Can dynamic population be used in some way to pick up the right values if these are 'stored' in another form as entries in specific locations? i.e. setup the tables off the pricing spreadsheet as a separate form and then have the result imported dynamically based upon the width and length input? Having the data held in another special for with all the rows and columns filled in. A form would be ideal since we could likely import a new one when pricing is changed. Or is there another more logical way to do this?

    I've never done anything this complex or used the calculations, conditionals or dynamic features of GF so any guidance or tips would be welcomed to save me going in the wrong direction. I do understand it will likely take a while to set up...

    Posted 11 years ago on Thursday December 6, 2012 | Permalink
  2. David Peralty

    I've been talking it over and the only way to do what you would want would be to put the data in a database, and then have two drop downs in your form. Then using custom AJAX, pulling the price from your database lookup and giving that value to a product field.

    Posted 11 years ago on Thursday December 6, 2012 | Permalink
  3. Thanks David. Think we understand. Do you have any documentation or examples that could assist? I also see there are now tools to do entry import to GF itself, http://wordpress.org/extend/plugins/gravity-forms-mass-import/
    but presumably what we want to do here is to have a new table in the sql db to store and access the pricing data? Again, this isn't my area of expertise, but eager to learn or alternatively outsource to someone who could do this bit.

    Posted 11 years ago on Friday December 7, 2012 | Permalink
  4. gcheak
    Member

    I have a similar requirement. From what I have read, querying data directly from the DB is a bad idea from a security standpoint.

    The TablePress plugin stores data in a Wordpress Custom Post Type. The data is a JSON array. I'm thinking that pulling data from that post using native Wordpress functions (and jQuery) is the way to go.

    I'm not sure how this would integrate with GF, but I bet it could be done.

    Posted 11 years ago on Friday December 7, 2012 | Permalink
  5. David Peralty

    I don't know how grabbing a price from the database is a bad idea from a security standpoint. But you might be able to do it the way you've mentioned. I just don't have much experience with JavaScript.

    Posted 11 years ago on Friday December 7, 2012 | Permalink
  6. gcheak
    Member

    I believe the emphasis was grabbing data outside of the Wordpress API. I haven't had to touch jQuery in a year or two. I do remember it working well for the job that I had. It was definitely a learning experience.

    Posted 11 years ago on Friday December 7, 2012 | Permalink