Body: <p>I'm trying to set up a system where when a member joins, they can add another member at a reduced rate.  I want the second member to log in and sign up, checking a box for a release for.  I thought the easiest way to do this would to give a discount code of 100% for the second member and the first member would pay for both.  I know I could create a new discount code for each member but I'd rather not fill up the database with one time discounts, so I would like to hook into the code  that the Apply button uses to examine the code entered and then change the amounts if it passes muster.  I thought I could just use hook_civicrm_preProcess and change the amount on the form but this doesn't work.  Is there a simple way to do this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-15T07:29:06.680Z
Comments.Text: Is this just when the first member is signing up (2-for-1 deal), or do you want the first member to be able to add a second member later?
Comments.UserDisplayName: Aidan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-15T12:30:47.033Z
Comments.Text: Just the first member.  He creates a membership for himself and pays for another one for which he is given the discount code.
Comments.UserDisplayName: Jack Donohue
Tags: <contributions><contribution-page>
Title: How to hook into civiDiscount code
ThreadText: # How to hook into civiDiscount code
  
  (Asked by: username_0 on 2019-10-14)
  
  I'm trying to set up a system where when a member joins, they can add another member at a reduced rate. I want the second member to log in and sign up, checking a box for a release for. I thought the easiest way to do this would to give a discount code of 100% for the second member and the first member would pay for both. I know I could create a new discount code for each member but I'd rather not fill up the database with one time discounts, so I would like to hook into the code that the Apply button uses to examine the code entered and then change the amounts if it passes muster. I thought I could just use hook\_civicrm\_preProcess and change the amount on the form but this doesn't work. Is there a simple way to do this?
  
  **Tags:** contributions, contribution-page
  
  > **Comments:**
  > **username_1**: Is this just when the first member is signing up (2-for-1 deal), or do you want the first member to be able to add a second member later?  
  > **username_0**: Just the first member.  He creates a membership for himself and pays for another one for which he is given the discount code.  
  
  ---
  
  ## 0 answers
  
  