10

I want (need) to implement a stadium ticket selling.
The idea is to let the customer choose his number of tickets (a capping on that might be needed but this is no big issue. I think I can achieve this through max qty allowed in cart). After that the customer must choose his seats from a seat map. After that the checkout process should go as usual.
Does anybody know an extension for this? I searched for one but I didn't find one to fit my needs. Or maybe my google skills need improvement.
If there is no extension, some pointers on how to do it would be great.
My idea so far is to create a product called 'Ticket' with some custom options (sector, row, seat number and maybe others).
The view page will be custom made, so the custom options will not be shown. The ticket selection will happen in a popup or overlay, and based on the selection I will simulate the custom options when adding to the cart.
The seat map will be kept in a table so I can mark the booked seats. The stadium is always the same so one map should be enough.
That's about it so far. Something seams to be missing. Any pointers would be great.
[EDIT]
There is a possibility to create a configurable product with 3 attributes (sector, row and seat number, each combination in qty available of 1 so they will not be available once they are bought), but this would mean 30k+ products (per event). I reeeealy don't want to go there. I'm keeping this as a last desperate resort.. (This is no longer an option because will result in a huuuuge performance issue)

10

I've done something like this, and this is a contrived example and over-simplified to see if you would even consider this to be a viable solution:

It's similar to defining a sudoku grid but that sudoku grid's open areas are open seats:

$section1 = <<<SECTION

A,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,
B,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-
C,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-
D,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-
E,-,-,-,-,-,-,-,-,-,-,-,-

SECTION;

That seat chart (sudoku grid) is stored on a per-product basis. Every event is a new product. The grid is updated when someone adds to the cart (or purchases, depending on business rules):

$section1 = <<<SECTION

A,-,-,x,-,-,-,-,-,x,-,-,x,x,x,x,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,
B,-,-,-,-,-,-,-,-,-,-,-,-,-,x,-,-,-,-,-,-,-,-,-,-,-,-,-
C,-,-,-,-,-,x,x,x,-,x,-,x,-,-,-,-,-,-,-,-,-
D,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-
E,-,-,-,-,-,x,-,x,-,x,-,x

SECTION;

To break apart seat availability in your backend model it's a simple explode:

$chart = array();

$section = trim(explode('\n', $product->getSeatingChart()));

foreach($section as $row){
    $seats = explode(',',$row);
    $rownum = array_shift($seats);
    $chart[$rownum] = $seats;
}

We can turn $chart into booleans:

array_walk($chart,function(&$s){
    $s = $s == "-" ? true : false;
});

Check if A14 is available (0 indexed, remember):

function checkAvailability($row,$seatnum){

    return $chart[$row][$seatnum-1] == true;

}

Upside:

Implementation is dead-simple: your seating availability attribute is parsed by a backend model. It's essentially a custom EAV attribute. You also can set up pricing based on sections. Each Section is a new SKU with a new price. You can block off seats at some events and not at others. Also, no need to carry real inventory, only set the qty on the sales order item during checkout for pricing.

Tiers will work, too, so you get bulk purchase discounts for free; that may have been a concern with custom options.

Downside:

Seat reservation is going to be your biggest headache because you don't carry actual inventory; that's where this method falls apart. Business rules will determine how you lock/hold seats during checkout.

  • 1
    +1 Woah. If anyone ever writes a "The Art of Magento Programming", this better be in there as an example. – kalenjordan Jul 18 '13 at 22:46
  • First of all I want to to say that I feel like an idiot. Of course the pricing should be on sections.I my mind the price was on every seat. D'oh!. As far as the donwside, I see none. I can have a simple table holding the reserved/bought seats for every event with columns event_id, sector, row, seat, status. Status can be 'reserved', 'bought', 'not available'. This way it seams easy to verify of someone reserved a seat 2 seconds before you did. I'm also thinking of creating a new product type (event ticket) so I will be sure there are no issues on product setup. Thanks for the details – Marius Jul 19 '13 at 7:17
  • Your answers seam to put together the puzzle pieces in my mind. I'm still concerned about performance issue, because selling 30k tickets in 4-5 days may stress the servers a lot, but this is a different issue. I will try to make this extension available for community once it's done and if I get the 'green light' from the customer. – Marius Jul 19 '13 at 7:21
  • 30k tickets - is this a NASCAR stadium? :) I think having a single ticket product per-section, per event (events are configs) will reduce your catalog size significantly. The smaller db footprint then hopefully fits entirely into memory... – philwinkle Jul 19 '13 at 18:21
  • 1
    @philwinkle I sent you an e-mail because I live in the 20th century and don't have a twitter account. – Marius Aug 2 '13 at 13:19
2

I agree configurable products aren't a great idea a seat is really only a pointer to if its available or sold and representing this with a Magento product sounds like overkill.

I'd suggest a custom module which would include a table of records for each Event, the tickets would then be for this Event and upon creation of an Event a simple product would be created to represent this in the store. You can use a product attribute to hold the reference to the event and custom options populated from the front end view page that you mention to store which seat was purchased.

  • Thanks. +1. Your answer combined with the one from philwinkle should at least get me started in the right direction. – Marius Jul 19 '13 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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