2 minutters læsning

Registration system for Drupal 7 using Commerce I needed a registration system for the Danish Folk Highschool, Vejle Idrætshøjskole, where you could register for the short courses and the lectures. I wanted the users to be able to pay their registrations online, so I choose Drupal Commerce which support a lot of the needed goodies out of the box.

Ditched the registration module

However, I needed some extra information about the registrants. First, I built the entire system using the registration and commerce_registration module. However, each registrant needs an e-mail in those modules. A lot of my registrants are married couples, which share an e-mail, or children which does not have an e-mail.

Used custom line items

So instead I chose to use some custom line items using the commerce custom product module. I followed a screencast about the module on commerceguys.com and I setup the needed custom product types and custom line item types to cater for my needs. You can see the entire code at github.com. By just doing that, I have a usable registration system, which is very easy to extend because it is just based on creating new product types and line item types. I also created some custom views to view the registrants, and I am planning on using views_send to make it possible to e-mail my registrants at once and with an easy interface.

Only allow the user to register for one item at a time

I altered the add to cart form a bit, so the registrant is only allowed to register for one item at a time. Each registration can have as many registrant as possible, but one registration can not have more courses or lectures. They have to start a new registration, if they want that. Inspired by an article about a similar need I altered the add to form cart with the code, you can find at our public github.

Heavily inspired my Commerce Kickstart

I still need to make some modifications to the flow - and I am heavily inspired by the really great commerce kickstart distribution. I still need to figure out:

  • add the price on the product attribute, so the user do not have to wait for the ajax to do its magic. I was hoping that this article where I revised the code slightly on this gist, was the answer, but could not get it to work.
  • how to have different flows depending on the product type in the cart - I have lectures and short course, but soon I will also have long courses.
  • how to make the best backend for the system to make it really easy for our office to administer the registrations

See the entire code for the site

You can see the entire code at github.com/vih. You can try out the assembled website from github.com/vih/vih-build

Kommentarer

You can be the first to add a comment below.

Leave a Comment

Din e-mail bliver ikke offentliggjort. Obligatoriske felter er markeret Required fields are marked *.

Indlæser...
Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.