Answers.Body: <p>I think you'd need to write a custom extension to handle this.</p>
  
  <p>I would create a custom field of type "contact reference" on your membership form so people could indicate their referring contact.  Of course, this exposes some (or all) of your contact names to the public, but it's better than manually connecting the records.</p>
  
  <p>Then you could write a simple extension that queries for the number of contacts that are referenced by this field on other contacts to calculate a discount.  Optionally, you could also clear the fields after that to prevent the discount from being applied to a future renewal.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-09T23:02:05.647Z
Answers.Text: If the 'contact reference' field was adjusted so it expected the Contact ID, and the member passed on his 'Contact ID' as the 'token' to use when submitting the form, would that avoid the exposure of data?
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-09T23:16:10.070Z
Answers.Text: @petednz-fuzion Yes, but at the cost of some usability.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-09T21:57:51.917Z
Answers.LastActivityDate: 2017-10-09T21:57:51.917Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>We have an offer for our existing members, that whenever any new member enrolls based on existing member's recommendation, that recommending member gets a fixed discount on his nearest membership fee. He can convinced as many new members, as he is able to do and by doing this he gets this discount for each of recommended new member and thus reduces his membership fee. Is it possible to calculate his discount every time he attempts to renew his membership? Any suggestions how to implement such functionality (CiviCRM 4.7 on WordPress)?</p>
  
Tags: <civimember><discounts>
Title: Is there a way of automatic discounting renewals based on referrals?
ThreadText: # Is there a way of automatic discounting renewals based on referrals?
  
  (Asked by: username_0 on 2017-09-29)
  
  We have an offer for our existing members, that whenever any new member enrolls based on existing member's recommendation, that recommending member gets a fixed discount on his nearest membership fee. He can convinced as many new members, as he is able to do and by doing this he gets this discount for each of recommended new member and thus reduces his membership fee. Is it possible to calculate his discount every time he attempts to renew his membership? Any suggestions how to implement such functionality (CiviCRM 4.7 on WordPress)?
  
  **Tags:** civimember, discounts
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-10-09. Score: 2
  
  I think you'd need to write a custom extension to handle this.
  
  I would create a custom field of type "contact reference" on your membership form so people could indicate their referring contact. Of course, this exposes some (or all) of your contact names to the public, but it's better than manually connecting the records.
  
  Then you could write a simple extension that queries for the number of contacts that are referenced by this field on other contacts to calculate a discount. Optionally, you could also clear the fields after that to prevent the discount from being applied to a future renewal.
  
  > **Comments:**
  > **username_2**: If the 'contact reference' field was adjusted so it expected the Contact ID, and the member passed on his 'Contact ID' as the 'token' to use when submitting the form, would that avoid the exposure of data?  
  > **username_1**: @username_2 Yes, but at the cost of some usability.  
  
  ---
  
  