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 Price

  1. Hi,
    I want to add this functionality to the form. I want the price per unit to decrease when quantity is increased. I am using products (drop-down) and quantity (drop-down) fields. I have a very simple php if-else condition for this but i am dont know how to integrate this with the form. I have read about using hooks but i failed to use them. Please help me with this. Here is the php statement

    function get_price(baseprice, quantity){
    
          if(quantity ==1)
          {
           total_price = baseprice*quantity;
          }
          else if(quantity>1 && quantity <=10)
          {
           total_price = (baseprice-(baseprice*5/100))*quantity;
          }
          else if(quantity>10 && quantity <=20)
          {
           total_price = (baseprice-(baseprice*10/100))*quantity;
          }
          else if(quantity>20 && quantity <=50)
          {
           total_price = (baseprice-(baseprice*15/100))*quantity;
          }
          else if(quantity>51 && quantity <=100)
          {
           total_price = (baseprice-(baseprice*20/100))*quantity;
          }
          else if(quantity>=101)
          {
           total_price = (baseprice-(baseprice*25/100))*quantity;
          }
          return total_price;
       }

    Can you please tell me how to use this with a hook and where to place the code.
    Thanks.

    Posted 12 years ago on Wednesday January 18, 2012 | Permalink
  2. Have you seen this tutorial?

    http://www.gravityhelp.com/documentation/page/Gravity_Forms_Pricing:_Adding_Tax

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