Auto or Batch Registration for Seasons Pass

  • Cory S
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 2 weeks ago #28825 by Cory S
We have a special Event, which is a Seasons Pass, that allows you to register for free for the other 4 events of the season. Currently, when someone buys the Seasons Pass, we then have to email them a Coupon Code, and they have to come back to the system and manually register again for each of the 4 events. A less then ideal customer experience. (We don't use Shopping Cart because it fails to calculate totals correctly when you use the special Fee fields for discounts.)

I'm hoping there might be a better way, or at least a small change to the system to make this easier.

The ideal workflow would be that when a customer buys the Seasons Pass, during processing the registration, they are automatically registered for the other 4 individual events. I haven't looked in detail at the code, but perhaps a simple looping functionality that iterates through each event and registers them using the info provided at registration. I'd be open to hard-coding event info, since this is only needed at the beginning of the season. I could back the code change out later.

Another workflow could be a batch upload to register for all 4 events. Either a CSV file upload, or even duplicating rows in the database, but that seems a bit more risky.

Anyone solved this problem before? Suggestions/hints on how to make the necessary changes to handle the auto-registration functionality?

Thanks,
Cory

Please Log in or Create an account to join the conversation.

More
11 years 2 weeks ago #28835 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Auto or Batch Registration for Seasons Pass
Hi Cory

The solution here is developing a plugin for Events Booking. You can use onAfterPaymentSuccess event in this case. Basically, you will need to write a plugin so that when users register for that event, you can add registration records for him for the other events in the season.

This will require you know Joomla plugin programming. Look at one of available plugins come with Events Booking (see them in plugins/eventbooking folder on your site) and you will understand how to write that plugin.

Tuan

Please Log in or Create an account to join the conversation.

  • Cory S
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 1 month ago #42497 by Cory S
Hi Tuan,

I finally got around to writing the plugin, and it works, for the most part. I am building the SQL statement and executing it against the database to write the additional 'registrations' into eb_registrants table.

Two issues:
1. I wasn't able to use the DBO to do the INSERT, it kept failing.
2. None of the custom fields from the original registration are obviously getting written into the eb_fields_values table.

I could write another SQL statement to insert those, but was hoping there might be some common code that already takes care of creating the registrant and creating the custom field entries, without having to write all the custom SQL?

Thanks,
Cory

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #42573 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Auto or Batch Registration for Seasons Pass
Hi Cory

Unfortunately, we don't have common code in the extension to store registrants and custom fields. So you will have to write SQL command to insert the data in this case.

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Cory S
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 1 month ago #42581 by Cory S
Hi Tuan,

I found code in field() and fields() that I was able to make work, without having to write SQL code.

I basically did the following, stripping out the other code that I added to maninpulate values:
$registrant->bind($row);
$registrant->store();
//Set custom fields
$jcFields = new JCFields($registrant->event_id, false, 0);
$jcFields->saveFieldValues($newId);

It works great now, just what I need it to do.

Thanks,
Cory

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #42668 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Auto or Batch Registration for Seasons Pass
ah ah , sorry. Mis-understood your question and could not give you the correct answer. Glad you were able to find out it yourself .

Regards,

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc