CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Allowing someone to Register ONLY a different person
Pages: [1]

Author Topic: Allowing someone to Register ONLY a different person  (Read 1235 times)

samutech

  • Guest
Allowing someone to Register ONLY a different person
January 21, 2010, 06:40:43 am
I've got a problem with CiviEvent registration, and I'm wondering how best to handle it. Here is the scenario:

"Bob" is logged in my Drupal site, so his CiviContact record is matched up with his Drupal login. He registers himself for the event. This works fine. A day later, he decided that he wants to register "Jane", as well. He goes back to the form, but his name and email are filled in. Allow multiple registrations from the same email address is checked, so he can register, but if he puts Jane's name in, HIS contact record name is changed to Jane. It would not have been a problem if he'd registered both of them using the "Register more participants" feature, but there are several situations in my case where this won't be feasible. I need to allow him to make two totally separate transactions.

Is there any way for a logged in user to register ONLY somebody else without changing his own contact information?

I've seen several threads about contact matching issues, but in this case, I don't think it's a matter of the record matching rules. Bob is logged in, so even if he uses a different email address, it changes the email address on his contact record instead of making a new record.

Anyone deal with this problem before or have ideas about how I handle this? I don't want to have to hack up the contact processing code for CiviEvent if I don't have to.

Thanks.

samutech

  • Guest
Re: Allowing someone to Register ONLY a different person
January 21, 2010, 11:02:27 am
Okay, so I've worked out something. It's not ideal, but here's what I've got:

I created a custom field called "This Ticket is for Me", and added it to the participant information profile. Then, I added some code to look for this field to be set in CRM/Event/Form/Registration/Confirm.php:

Code: [Select]
public function updateContactFields( $contactID, $params, $fields )
{
      //HERE IS MY ADDITION: This allows people to buy primary tickets not for themselves.
      if(isset($params['custom_147']) && $params['custom_147'] == 0) {
        $contactID = null;
      }
      //END OF ADDITION
        //add the contact to group, if add to group is selected for a
        //particular uf group
 
        // get the add to groups
        $addToGroups = array( );
        ...

It seems to work, though obviously now I've got a piece of code that's dependent on a custom field that is created in the DB...not ideal, but it looks like it'll get me out of this jam.

If anyone has better ideas, I'm still open to hearing them. This doesn't seem like the best for maintainability.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Allowing someone to Register ONLY a different person
January 21, 2010, 03:44:49 pm
Can you suggest that if they want to register someone other than themselves that they log out and do it as Anon?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

samutech

  • Guest
Re: Allowing someone to Register ONLY a different person
January 22, 2010, 05:19:06 am
Yes, I considered that, but I have a module that is discounting the price for people who have memberships. So, if I have them log out, they can't get that special pricing.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Allowing someone to Register ONLY a different person

This forum was archived on 2017-11-26.