12 replies [Last post]
escoles@drupal.org's picture
Offline
Joined: 01/14/2009
Juice: 78
Was this information Helpful?

I'm trying to set up event registration. The client's requirements boil down to:

  • Volume discount. (more than 4 = cheaper, but only if all from same institution)
  • Date-linked discount. (before date y = cheaper)
  • Each reservation corresponds with a record that includes contact information. (I.e., not just buying "seats" -- actually registering people.)

I've had an idea about how I wanted to do this, but looking at the solutions in the forums for similar problems -- well, they're much more complex. So I'd like to do a sanity check on my approach.

Would really like to be able to do this in D6/UC2.x.

Here's what I had planned to do:

  1. Create a product that has attributes corresponding to all the information I want -- basically, a data-collection instrument.
  2. Constrain that product in such a way that you can't increment the units on the order -- e.g., you can't order 2 of 'Mary Rogers', but you can get one 'Mary Rogers' and one 'Mary Smith' (where the names are buyer-provided product attribute values). (I don't actually know how to do this, yet, so if this is difficult or impossible I suppose that's a gap in my plan.)
  3. The pricing and discounting rules I think I've got figured out how to manage.

So in principle I'd have orders that included one to x people, with all the information the client would need to be in touch with them (email, phone, company/institution name, etc.). I'm assuming it might be slightly difficult to get the data into a useful form, but nothing someone clever with SQL couldn't dope out. (I know such a person.)

So, is there anything wrong with this idea? Am I missing something? (Other than the fact that I don't yet know how to keep people from buying 6 'Mary Rogers'.)

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Event Registration, again (maybe different)

There are two contributed modules that will make your life a lot easier:

  • UC Node Checkout - lets you associate a node type with a product in the catalog, so when the customer clicks "Add to cart" they have to first fill out a node form of the associated type. This means you can use CCK to build the person's registration form. This is how I built the Do It With Drupal conference registration site.
  • UC Restrict Qty - enables a product feature called "Restrict Qty" that you can add to a product so the customer can only add 1 to the cart and can't change it on the cart form.

After that, you'll be a little on your own for the discounts stuff, though I know of a couple efforts to get those working through the new Conditional Actions system in UC 2.x.

escoles@drupal.org's picture
Offline
Joined: 01/14/2009
Juice: 78
Re: Re: Event Registration, again (maybe different)

Thanks for the pointers. (Especially restrict quantity, which seems to be perfect for what I'm trying to do.)

Re. associating with nodes: I was hoping to limit the proliferation of nodes. Maybe I'm overly concerned with that, but I keep thinking that if I have a large number of purchased-item nodes, it will make maintenance more difficult. But I will be able to manage the purchased-item nodes through the orders interface, right?

Maintenance will be a key feature in the long term. I won't be maintaining this site, just building it -- I need to put a premium on human-maintainability (i.e., need to be able to teach an administrative staff-member at the client's to keep it up).

I'm mostly done mocking up the approach I outlined above, so I'll get that working then look at doing it the way you've done it. I've got to get this all working by late tomorrow for a launch on Thursday. (Cutting it fine, I know. Long boring story.) So quick is important.

I got the discounts mostly working in rough form a couple of weeks ago, before I had to shift to another project. Now I just have to remember how I did it...

One advantage I have with this is that it's an interim site -- just taking registrations for this conference until we can get their whole website re-launched. I can more or less tear it down and start from scratch when I launch the re-designed main website in April. So I could do it my way (which might be harder to maintain) now, and the way you suggest (which will be harder to configure) for next year's conference.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Event Registration, again (maybe different)

The main advantage of UC Node Checkout is that you can build the node type (which acts as a registration form) in CCK which is instantly Views accessible. All the data you collect can then be dropped into a View that will be a lot easier for the end user to manage than clicking through all the orders to look at attributes on products. The attribute data for ordered products is serialized in a single text column in the order products table (ugly, yes? Sticking out tongue), so it will be a lot harder to work with.

With a bit of custom code, you can add fields to the registration node type that you populate upon checkout. I did this for DIWD, where I had a hidden "Order link" textfield that after purchase was populated w/ a link to the order View page. In the View I built for them to manage registrations, I made sure this field was there so they could easily hop to the order if need be.

escoles@drupal.org's picture
Offline
Joined: 01/14/2009
Juice: 78
Ryan wrote:... The attribute
Ryan wrote:

... The attribute data for ordered products is serialized in a single text column in the order products table (ugly, yes? Sticking out tongue), so it will be a lot harder to work with.

Oye! Good point. So maybe I'll look at this sooner rather than later.

Ryan wrote:

With a bit of custom code, you can add fields to the registration node type that you populate upon checkout. I did this for DIWD, where I had a hidden "Order link" textfield that after purchase was populated w/ a link to the order View page. In the View I built for them to manage registrations, I made sure this field was there so they could easily hop to the order if need be.

Do you mean, like an anchor? And a link to the anchor? Not sure I follow you.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Ryan wrote:... The attribute

Yeah, I put a link in there, like <a href="/admin/store/orders/##">Order ##</a> and had that display in the View for easy clickage. Smiling

escoles@drupal.org's picture
Offline
Joined: 01/14/2009
Juice: 78
Re: Re: Ryan wrote:... The attribute

Cool. Very obvious once you hear it described, but it never occurred to me before.

Dewi Morgan's picture
Offline
Joined: 02/18/2009
Juice: 19
Re: Re: Re: Ryan wrote:... The attribute

I've been documenting my progress on a similar system here:
http://www.ubercart.org/forum/support/9165/course_booking_employees_mana...

There might be something useful for you there.
If you have any ideas to contribute yourself, please do!

mliu's picture
Offline
Joined: 02/23/2009
Juice: 65
Where is the custom code to write back to registration node

RYAN SAID:
With a bit of custom code, you can add fields to the registration node type that you populate upon checkout. I did this for DIWD, where I had a hidden "Order link" textfield that after purchase was populated w/ a link to the order View page. In the View I built for them to manage registrations, I made sure this field was there so they could easily hop to the order if need be.

QUESTION:
Where does one put this custom code? Can someone give an example please?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Where is the custom code to write back to registration node

I put it in a custom module for the site and used hook_order().

mliu's picture
Offline
Joined: 02/23/2009
Juice: 65
How do transactions work in Drupal .... as side note on hook_or

I am new to Drupal innards .... how do database transactions work for an order process for example?
It seems there are updates/creates to the database at different points of the work flow ... and if the power fails etc. .... do we possibly get incomplete records? Or we look at the status of orders which get updated at different points of time.

Don't mean to bother you all ... but any way I can get the sample code in hook_order()?

Mike

gregoryheller's picture
Offline
Joined: 02/18/2009
Juice: 92
Re: Re: Where is the custom code to write back to registration n

can you offer that custom code somewhere ryan? I could see a uc_node_checkout helper module that would allow you to map certain ubercart data to uc_node_checkout fields through the GUI.

I'd like to map customer name data for example, they are going to fill it out anyway during checkout, why not "default" the fields in uc node checkout to be the same as the customer data? order and status are two that most people would probably want, as well as product information and attributes.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Where is the custom code to write back to registrati

Meant to post that in your other thread - just did. Smiling