Answers.Body: <p>I think you can add <code>cid=0</code> to your url.</p>
  
  <p>For example, <code>https://example.com/civicrm/contribute/transact?reset=1&amp;id=1&amp;cid=0</code> will force the creation of a new contact and new membership even you are logged in and already have a membership.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-31T12:57:53.080Z
Answers.Text: This is super interesting; it does suppress the membership renewal behaviour, but it also causes this message to appear: "You are completing this form on behalf of someone else. Please enter their details.
  Click here to select someone already in our database."
  
  We are also using CiviRelate to create a relationship between the user's individual contact and the Organization they create in the membership signup process; this is still created successfully, but only if the user enters their registered email address in the email field in the membership block.
Answers.UserDisplayName: poorhaus
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-28T23:30:27.533Z
Answers.LastActivityDate: 2015-07-28T23:30:27.533Z
Answers.UserDisplayName: samuelsov
Body: <p>For our use-case, individuals never directly hold memberships, only organizations do, so we force the On Behalf Of Organization part of the contribution page. There's a different contribution page for New Membership than for Membership Renewal, but they both behave identically more or less for users that already have memberships. </p>
  
  <p>We need the New Membership profile to ALWAYS create a new Organization and a new membership for the created org; currently when a logged-in user with existing current or expired memberships goes to the New Membership page, the membership section shows the renewal options instead of the New Membership options. When a user selects "Create A New Organization" and fills in the details, the membership part of the page just picks the existing membership that is uppermost in the Organization Name dropdown and renews it for another year instead of creating a new membership. </p>
  
  <p>Is this the expected behaviour, and can it be suppressed? Is there a URL parameter I can pass in that will force a new membership?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I should say, this is with version 4.4.10 for Drupal. </p>
  
  <p>It looks like it makes the decision in civicrm/CRM/Member/Form/Membership.php, line 205:</p>
  
  <p><code>if ($this-&gt;_contactID) {
          //check whether contact has a current membership so we can alert user that they may want to do a renewal instead</code></p>
  
  <p>Any thoughts about how to programmatically suppress this without hacking core? My unhealthy temptation would be to do something along these lines:</p>
  
  <p><code>if ($this-&gt;_contactID AND !($_REQUEST["forceNew"]=1)) {
          //check whether contact has a current membership so we can alert user that they may want to do a renewal instead, check for "forceNew" flag in request params</code></p>
  
  <p>which of course would be a maintenance nightmare. Is there a hook I can use instead that will allow me to change the form's behaviour? Unsetting $this->_contactID with a hook sounds unwise, but that's how it makes the call.</p>
  
  <p>Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-27T23:11:57.247Z
Comments.Text: I admit to not fully following this - but this code function https://github.com/eileenmcnaughton/nz.co.fuzion.membershiprenewalcontrol/blob/master/membershiprenewalcontrol.php#L115 is one I use to force a new membership rather than a renewal in the post hook.
  
  You might be better off using a form hook of course http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference
  
  since that would kick in for all membership changes.
Comments.UserDisplayName: eileen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-28T23:24:16.523Z
Comments.Text: @EileenMcNaughton: I think it is a valid answer rather than a comment
Comments.UserDisplayName: samuelsov
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-29T23:53:30.077Z
Comments.Text: I feel like choosing answer obliges me to have a real answer - comments seem to much less threatening (I miss our cosy forum :-)
Comments.UserDisplayName: eileen
Tags: <civimember><contributions><contribution-page>
Title: Can a contribution page that has a membership section be forced to create a new membership?
ThreadText: # Can a contribution page that has a membership section be forced to create a new membership?
  
  (Asked by: username_0 on 2015-07-27)
  
  For our use-case, individuals never directly hold memberships, only organizations do, so we force the On Behalf Of Organization part of the contribution page. There's a different contribution page for New Membership than for Membership Renewal, but they both behave identically more or less for users that already have memberships.
  
  We need the New Membership profile to ALWAYS create a new Organization and a new membership for the created org; currently when a logged-in user with existing current or expired memberships goes to the New Membership page, the membership section shows the renewal options instead of the New Membership options. When a user selects "Create A New Organization" and fills in the details, the membership part of the page just picks the existing membership that is uppermost in the Organization Name dropdown and renews it for another year instead of creating a new membership.
  
  Is this the expected behaviour, and can it be suppressed? Is there a URL parameter I can pass in that will force a new membership?
  
  **Edit:**
  
  I should say, this is with version 4.4.10 for Drupal.
  
  It looks like it makes the decision in civicrm/CRM/Member/Form/Membership.php, line 205:
  
  `if ($this->_contactID) {
  //check whether contact has a current membership so we can alert user that they may want to do a renewal instead`
  
  Any thoughts about how to programmatically suppress this without hacking core? My unhealthy temptation would be to do something along these lines:
  
  `if ($this->_contactID AND !($_REQUEST["forceNew"]=1)) {
  //check whether contact has a current membership so we can alert user that they may want to do a renewal instead, check for "forceNew" flag in request params`
  
  which of course would be a maintenance nightmare. Is there a hook I can use instead that will allow me to change the form's behaviour? Unsetting $this->\_contactID with a hook sounds unwise, but that's how it makes the call.
  
  Thanks!
  
  **Tags:** civimember, contributions, contribution-page
  
  > **Comments:**
  > **username_1**: I admit to not fully following this - but this code function https://github.com/username_1mcnaughton/nz.co.fuzion.membershiprenewalcontrol/blob/master/membershiprenewalcontrol.php#L115 is one I use to force a new membership rather than a renewal in the post hook.  You might be better off using a form hook of course http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference  since that would kick in for all membership changes.  
  > **username_2**: @EileenMcNaughton: I think it is a valid answer rather than a comment  
  > **username_1**: I feel like choosing answer obliges me to have a real answer - comments seem to much less threatening (I miss our cosy forum :-)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-07-28. Score: 1
  
  I think you can add `cid=0` to your url.
  
  For example, `https://example.com/civicrm/contribute/transact?reset=1&id=1&cid=0` will force the creation of a new contact and new membership even you are logged in and already have a membership.
  
  > **Comments:**
  > **username_0**: This is super interesting; it does suppress the membership renewal behaviour, but it also causes this message to appear: "You are completing this form on behalf of someone else. Please enter their details. Click here to select someone already in our database."  We are also using CiviRelate to create a relationship between the user's individual contact and the Organization they create in the membership signup process; this is still created successfully, but only if the user enters their registered email address in the email field in the membership block.  
  
  ---
  
  