Selling Tickets with commerce

Hi!

One of my clients has an extensive MODX event list but sells the tickets for these events via eventbrite. This doubles part of the work so I thought maybe Commerce could help. The basics should work, but my client uses some features of eventbrite that would be necessary for Commerce to deliver as well to replace it.

  1. Possibility to reserve (buy) tickets for free events without the need to enter payment data.

  2. If you buy more than one ticket to an event, it would be neccessary to enter the names (and emails) of all participants. The names should later be printed on participant lists.

  3. Possibility to decide what customer info is needed for a special kind of event. (E.g. they need mobile numbers only for a special outdoor-events)

  4. Email reminders with event information (dependend on event) three days in advance of date.

I guees point 4 is a bit out of range for a web shop, but could it be possible in principle?

As the events are at the moment handled as resources, would be best just to use resource-based products? The per-event-infotext could then be gotten from a TV, right?

Any insight is appreciated!

Commerce can be used for events (free and paid), but it’s not quite optimised for it. From a user and merchant perspective you’ll notice that you’re working with a somewhat generic product type, rather than something built with events in mind. That doesn’t have to be a problem - but especially when compared with something so specifically built for events like EventBrite, it’s worth exploring what your client expects.

You’ll definitely be able of improving the user (/merchant) experience with some custom development.

As for your 4 specific points:

  1. Free orders are already supported; the payment step in the checkout will immediately mark the order as ready for processing.
  2. ItemData module can be used for that, but it does not make fields required, so if you need a guarantee that the information is entered you could look at a custom add to cart snippet that performs the validation, and then adds it to the cart. There’s an export to get information from all orders that contain a specific product; but that may or may not be sufficient for printing names - please test that with the client.
  3. Requires custom development. At the moment you can configure which address fields are required with the basic address validation module but that’s not dynamic based on order contents.
  4. Requires custom development. I recently had to build something similar for SimpleCart, using Scheduler, and if you have some budget available I’d be happy to create an official Commerce extension that does the same for Commerce.

The resource product type is indeed convenient if you already have the information there, though keep in mind its limitations (e.g. no variations, not all custom functionality like custom order shipments can be used).

Thanks, Mark, as always quick and detailed!

  1. OK. I guess we could just say: “If you buy more than one ticket, enter name of participant and press ‘add to cart’ for every ticket you buy, one at a time”

As for the list export: Is there a snippet to loop over the order data in the front end? Then I could just use an HTML-Template on a page only visible to logged in admins to print the lists.

  1. Can you give me a broad estimate?

Re: resource products: Some prices would depend on the age of the participant. I understand that this would be difficult with resource products, right?

But if I use the productTV-setup, can I still refer to information from the resource TVs of the event (like addresses, special advices, etc)?

Nothing built-in, but that’s pretty straightforward with Commerce/xPDO.

If you don’t run it to often and don’t amass thousands of orders per month, something like this should work fine to start with:

<?php

// Instantiate the Commerce class
$path = $modx->getOption('commerce.core_path', null, MODX_CORE_PATH . 'components/commerce/') . 'model/commerce/';
$params = ['mode' => $modx->getOption('commerce.mode')];
/** @var Commerce|null $commerce */
$commerce = $modx->getService('commerce', 'Commerce', $path, $params);
if (!($commerce instanceof Commerce)) {
    return '<p class="error">Commerce is not currently available.</p>';
}

$c = $commerce->adapter->newQuery('comOrder');
$c->where([
    'test' => $commerce->isTestMode(),
    'status' => 5, // limits to a specific status that you should get orders for
]);

foreach ($commerce->adapter->getIterator('comOrder', $c) as $order) {
    $items = $order->getItems();
    foreach ($items as $item) {
        $product = $item->getProduct();
        if ($product && ($product->get(..) == '..')) { // check if it should be included
            echo $order->get('id') . ', ' . $item->getProperty('custom_field'); 
        }
    }
}

That can be further optimised if you do have a lot of data to go through, and you can get lots of information from the order depending on what exactly you’d like to load.

For the event notifications (4), it’s probably 2-4 hours of work or so. If you’d like to discuss specific requirements/prices/timelines, please email support@modmore.com to talk further.

With the product list tv you indeed don’t get the link to the resource ID automatically. With a resource product or matrix, you can get to it via item.product.target.