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) »
  • Register additional people - can I use a different profile for participant 2?
Pages: [1]

Author Topic: Register additional people - can I use a different profile for participant 2?  (Read 2499 times)

jdiff

  • I’m new here
  • *
  • Posts: 24
  • Karma: 2
Register additional people - can I use a different profile for participant 2?
January 15, 2009, 08:18:19 pm
Here's my scenario:
I want to allow people to register multiple people for an event.  I need to collect the name and address of the first person, in order to mail stuff to them.  I want to collect the names of the other people in their party, but I don't need the address information for these additional people.  Is it possible to use a different profile for the "additional people" than for the first person in the party?

So I want it to work like this:
First screen (for participant 1) collects name and address.  User clicks button to register multiple people, and inputs 1.
Next screen (for participant 2) collects only name.
Next screen is summary screen.

Is this possible?
Thanks!

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Register additional people - can I use a different profile for participant 2?
January 15, 2009, 08:56:26 pm
Have you included profile for your Event Page ? What about making address related fields in profile not required ? So that when you are entering second participant you can just enter name and ignore address fields..

HTh

Kurund
Found this reply helpful? Support CiviCRM

jdiff

  • I’m new here
  • *
  • Posts: 24
  • Karma: 2
Re: Register additional people - can I use a different profile for participant 2?
January 16, 2009, 06:56:20 pm
Thanks for the quick reply Kurund.

What you suggest is what I am doing currently.  I added text that says the address is required for the primary registrant but not required for additional participants. 

Although kludgy, it does work as far as the registration.  But there is a big problem with the transfer to Paypal.  After the confirmation screen, clicking "Continue" sends the user to PayPal to pay.  (I am using PP WPS).  The problem is that if the primary registrant does not include the address info, I get the following error message when clicking "Continue" from the confirmation screen:

Warning: urlencode() expects parameter 1 to be string, array given in /home/xxx/xxx/xxx/public_html/civicrm/CRM/Core/Payment/PayPalImpl.php on line 385

Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/xxx/xxx/public_html/civicrm/CRM/Core/Payment/PayPalImpl.php:385) in /home/xxx/xxx/xxx/public_html/civicrm/CRM/Utils/System.php on line 311.



Certainly requiring all the address fields will eliminate the possibility of a user encountering this error.  But it also then requires the user to enter the same redundant address information for all the additional participants, which is what I'd like to avoid.

I'm working on a method to automatically propagate the primary registrant's address information to all of the additional participants, but I'm not so good with PHP.  I think this might be the best compromise.


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Register additional people - can I use a different profile for participant 2?
January 17, 2009, 06:32:47 am
Quote from: jdiff on January 16, 2009, 06:56:20 pm
Warning: urlencode() expects parameter 1 to be string, array given in /home/xxx/xxx/xxx/public_html/civicrm/CRM/Core/Payment/PayPalImpl.php on line 385

Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/xxx/xxx/public_html/civicrm/CRM/Core/Payment/PayPalImpl.php:385) in /home/xxx/xxx/xxx/public_html/civicrm/CRM/Utils/System.php on line 311.


This is a bug with 2.1. I've patched it for 2.2. You can apply this patch:

Code: [Select]
svn diff CRM/Core/Payment/PayPalImpl.php
Index: CRM/Core/Payment/PayPalImpl.php
===================================================================
--- CRM/Core/Payment/PayPalImpl.php     (revision 19388)
+++ CRM/Core/Payment/PayPalImpl.php     (working copy)
@@ -343,11 +343,11 @@
             $name  = count( $parts ) > 1 ? $parts[0] : $p;
             if ( isset( $otherVars[$name] ) ) {
                 $value = $params[$p];
-                if ( $name == 'state_province' ) {
-                    $stateName = CRM_Core_PseudoConstant::stateProvinceAbbreviation( $value );
-                    $value     = $stateName;
-                }
                 if ( $value ) {
+                    if ( $name == 'state_province' ) {
+                        $stateName = CRM_Core_PseudoConstant::stateProvinceAbbreviation( $value );
+                        $value     = $stateName;
+                    }
                     $paypalParams[$otherVars[$name]] = $value;
                 }
             }

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jdiff

  • I’m new here
  • *
  • Posts: 24
  • Karma: 2
Re: Register additional people - can I use a different profile for participant 2?
January 17, 2009, 07:00:42 pm
Thanks lobo for the patch.  I've got it working now.

tabidi

  • I post occasionally
  • **
  • Posts: 34
  • Karma: 5
Re: Register additional people - can I use a different profile for participant 2?
January 17, 2009, 07:09:51 pm
I would also like to see the ability to specify a different profile to use for additional participants. For my primary registrant to the event I want to capture fields like country, city, state but for my additional participants I do not want to capture those details.

Also is there some sort of link between the additional participants and the primary contact. It would be great to be able to link the 2 through some relationship. Guess that could be an option too.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Register additional people - can I use a different profile for participant 2?
January 17, 2009, 08:26:43 pm

Please consider contributing a patch for the below features.

For the first one, you will need to add another field to the database to store the "profile id" for the additional participant form if different from the standard.

There is a column called "registered_by_id" which links the additional participants to the main participant. I suspect you can use a hook or a cron job to create relationships between the main participant and the additional participants

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Register additional people - can I use a different profile for participant 2?

This forum was archived on 2017-11-26.