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.

Dynamically change product price field

  1. Rol0572
    Member

    Hello,

    Using gravity form product field type, I would like to dynamically change the price field depending the quantity field. For example :

    if the user type 10 in the quantity field, price may become 1 €. If the user type 20, price become 2 €, ... I need to dynamically set price depending on quantity value.
    I saw this link without real answer :
    http://www.gravityhelp.com/forums/topic/change-price-product-field-amount-according-to-quantity-discounts

    The grid that fix price depending the quantity range can be long (arround 50 lines)

    I'm a beginner in gravity form with some knowledge in PHP. What is the best way to do that. Can it be done with some hook ?

    Thanks.

    Posted 9 years ago on Thursday March 7, 2013 | Permalink
  2. One way to do it would be to have a quantity drop down, with choices for each of your price breaks. Then, use conditional logic to show different products (actually the same product, with a different price, based on the quantity) using conditional logic based on the drop down selection. I'm not sure how many price breaks you have, or if that's what you meant by '50 lines' (of price breaks?) If that's the case, the drop down won't work very well (too hard to manage.)

    Posted 9 years ago on Tuesday March 12, 2013 | Permalink
  3. Rol0572
    Member

    Thanks for answer,

    I would like to create a form for "work request". User can choose a product from lookup list and it can be 50 base product * 10 or more different quality. For this, I think I can populate a drop down (for different quality) depending on parent choice using hook (gform_pre_render).

    Each product and quality have different price depending of the quantity.
    There are 4 quantity range :
    From 1 to 10, from 11 to 100, from 101 to 500, and from 501 and more. So they are only 4 prices break but arround 4*50*10 different price.

    The quantity field must be freely typed (without drop down) because they are too many choice for a dropdown list.

    For now, I'm learning gravity form and would know if I can do this with gravity form without using advanced jquery programming. If yes, I want to know where is a good starting point, what is the best way to do this (conditional logic, allow dynamic content update, hook).

    Posted 9 years ago on Tuesday March 12, 2013 | Permalink
  4. I don't know of a way to do it with a free text quantity field. You would not be able to use conditional logic based on that field. The only way I can think of is to do it with Gravity Forms.

    Do you have an example of this functionality online somewhere where we can see it? It might help us come up with another solution.

    Posted 9 years ago on Thursday March 14, 2013 | Permalink