2

We need to build a ticketing system for venue tours, that happen every week within certain date ranges, and with an option to exclude specific dates from the availability list.

Looking at Solspace Calendar, it offers almost exactly the fields we need for this out of the box: (screenshot below)

But I can't figure out how to either:

(1) Recreate this setup as fields on a Commerce product .

(2) Create a relationship between a Solspace Calendar event and a Commerce product (that only allows for a certain number of products to be sold for each date in the calendar).

enter image description here

  • So far I've got this: (1) Use Solspace Calendar to define each tour as a repeating event. (2) Then query that event list and display a Commerce "Buy product" form for each event occurance, with a hidden options param for the date/time (3) This means that the Commerce item has a "tour-date" options param when added to the cart / purchased, which stores the date/time Then just need something to prevent people purchasing a tour that has already been sold... not sure if querying already-placed orders for these date is madness... – James Greig Feb 11 at 15:35
2

I think you will have to get your hands a bit dirty with this one.

The Calendar Events fieldtype will get you part of the way, but you still need some module code to pull this off.

A suggested approach is:

  1. Create a product type with the Events fieldtype
  2. Create some module code that creates/updates a product + variants for each date, where the inventory is set to n.
  3. List the events as you would normally do, and pull in the products and its variants with the reverse relationship.

If the available number of tickets is always the same, you could have one field on the event where you enter the number.

If the amount of tickets vary by day, there is probably multiple approaches. Maybe a Matrix field that assumes position of block with quantity field === date in same position/with a date picker, maybe something else.

You can create a example module over at pluginfactory.io

  • Awesome thanks @Fred. Ticket availability is the same for every event. – James Greig Feb 13 at 14:39

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.