Drupal - How do I sell tickets?

Here is the method I used. It covered all of the functionality I needed, and we ended up with a very robust website, using popular well maintained modules, and getting the exact results we needed.

Modules used

  1. Commerce
  2. Commerce_agree_terms
  3. Commerce_autosku
  4. Commerce_cart_expiration
  5. Commerce_event_ticket (For PDF creation)
  6. Commerce_stock
  7. Date API
  8. Inline Entity Form
  9. Rules
  10. Views

These were the main ones. There are also modules these rely on, and others I used for other purposes. But I am trying to keep this to the ticket functionality only, rather than explain how to build an entire site.

Method

  1. Enable all modules.
  2. Create a commerce product called "Ticket" (Or re-name the default enabled product).
  3. Manage the fields on the "Ticket" content type, and add a date field called "booking window". This should collect a start and end date, and will allow an admin to define when these tickets are available for sale.
  4. Enable Commerce Stock on the Ticket Product to allow an admin to define the amount of tickets available for each ticket.
  5. Create a content type called "Event".
  6. Add an In-line Entity field allowing the user to create new products (Tickets). Allow unlimited values on this field if you wish (This allows a user to add an Early Bird Ticket, Standard, VIP etc.). We also disable "Allow a user to add existing products" as we want unique products to be created for every event. This is where the autosku module comes in handy for auto generation.
  7. Add a date field for the event date.

Once that is done, you have the basic functionality. You can create an "Event" node, add a ticket or multiple tickets (defining price, stock and booking window), add your event date and click save.

Next Steps

  1. Next you will need to manage the display for the content type "Event" and hide the display of the tickets field.
  2. Create a new view Block Display called "Ticket Display" for products. Add a field to show products (Tickets) as an add to cart form.
  3. Add a contextual filter "nid" and set the default value as "get content ID from URL".
  4. Add a filter to the view for the product (Tickets) booking window start date and use relative date "now" to only show products with a start date less than "now" and another filter with end date greater than "now".
  5. Go to structure > blocks, find your view block display, and restrict the block to only show on "event" content types. This will now mean the tickets only show on their referenced nodes, and only if the booking window is open. They will also be disabled if out of stock.

Adding a ticket holders names

  1. Manage the fields of the line items. Store > Configuration > Line item types > Product (Ticket) > Manage fields. Add a field for "Ticket holders name".
  2. On the "Ticket holders name" field settings, make sure you select "Include this field on Add to Cart forms for line items of this type".

Sending tickets to customers

  1. After enabling the commerce event ticket module, follow the modules instructions to generate a PDF for every ticket product.

For a full working demo of this, look here.. http://www.dev.thelhp.co.uk/ Please note this site is in development for now, but will try and charge you when it goes live!

Tags:

Commerce