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) »
  • How can I limit the number of "multiple" participants that one can register?
Pages: [1]

Author Topic: How can I limit the number of "multiple" participants that one can register?  (Read 725 times)

mirrorstage

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
  • CiviCRM version: 4.6.7
  • CMS version: Drupal 6.37
  • MySQL version: 5.6.23
  • PHP version: 5.4.42
How can I limit the number of "multiple" participants that one can register?
September 16, 2012, 06:51:13 pm
How can I limit the number of "multiple" participants that one person can register for an event? Currently it allows 10, how can I change this to registering five TOTAL, so teams are limited to only five (including the main registrant)?

I am still a novice coder at best; so, clear explanations spelling out every step and where to find things in the code would be much appreciated.

THANKS!
« Last Edit: September 16, 2012, 07:38:19 pm by mirrorstage »

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: How can I limit the number of "multiple" participants that one can register?
September 17, 2012, 04:28:56 am
mirrorstage :

This maximum no. is currently hard-coded to 10 for now though we may make need to make this configurable per event.

You might want to check the buildQuickForm function around line no 345 in CRM/Event/Form/Registration/Register.php

HTH
-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

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: How can I limit the number of "multiple" participants that one can register?
September 17, 2012, 07:01:33 am
You might want to use the hook_civicrm_buildForm hook instead of hacking the code

Check the developer handbook:

http://book.civicrm.org/developer/

for examples

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

EdP

  • I post frequently
  • ***
  • Posts: 260
  • Karma: 7
  • CiviCRM version: 4.4
  • CMS version: Joomla 2.5.x
Re: How can I limit the number of "multiple" participants that one can register?
September 17, 2012, 08:17:30 am
Alternatively don't allow multiple registrations, and using a Price Set sell "team of 5". They won't be able to fill out a profile for each team member, but at least it means that the expectation is set that they should be registering 5 people. They can of course register more than one team of 5, but then that's more of a concious decision and easier to reverse.

mirrorstage

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
  • CiviCRM version: 4.6.7
  • CMS version: Drupal 6.37
  • MySQL version: 5.6.23
  • PHP version: 5.4.42
Re: How can I limit the number of "multiple" participants that one can register?
September 17, 2012, 09:16:57 am
Lobo,

I have built the .info and .module file, but I am still unclear what coding language I need to use in coding the .module file as a buildForm hook to limit the number of  additional registrants.

If anyone can tell me exactly how to change the following to accomplish what I want, I'd really appreciate it:

Code: [Select]
function example_civicrm_buildForm($formName, &$form) {
  if ($formName == 'CRM_Event_Form_Registration_Register') {
    if ($form->getAction() == CRM_Core_Action::ADD) {
      $defaults['price_3'] = '710';
      $form->setDefaults($defaults);

Ed, not everyone participating in the event is registering a team, and teams are not required to be five, they just shouldn't exceed five, total. Price sets wouldn't really work as a solution for this, especially since it's a free event. It's more important for teams to register each member's Twitter handle and mobile phone number, without exceeding five team members, total. Your solution doesn't address the main issue, but I appreciate your desire to help.

mirrorstage

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
  • CiviCRM version: 4.6.7
  • CMS version: Drupal 6.37
  • MySQL version: 5.6.23
  • PHP version: 5.4.42
Re: How can I limit the number of "multiple" participants that one can register?
September 17, 2012, 10:54:09 am
It seemed easiest to go with Yashoda's hack. It was simple and straightforward, and if we ever have an event for which we want to allow more additional registrants, I know where to go.

Thanks everyone for your assistance!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • How can I limit the number of "multiple" participants that one can register?

This forum was archived on 2017-11-26.