Multiple limited-amount products in Act?

Sébastien Aperghis-Tramoni sebastien at aperghis.net
Fri Feb 7 01:33:51 CET 2014


Salve J Nilsen wrote:

> Hei!

Hello Salve,

> Oslo.pm is organizing a triple-event about Mojolicious in Oslo ultimo May. We're planning on the following:
> 
> Mojolicious 1-day class, €500 (est), limited capacity, on May 23rd
> Mojo.conf 1-day conference, €20, limited capacity, on May 24th
> Mojolicous 1-day hackathon, free, limited capacity, on May 25th
> 
> Regarding this, I have a couple questions/requests:
> 
> 1) How do I limit the amount of products available of a given type? (e.g. We have only room for 12 attendees on the course, and have to make sure no more than 12 tickets are sold for it). The same goes for the conference (140) and hackathon (20)).

There's the registration/max_attendees config parameter for setting a global maximum number, but no such parameter per product. Looking at this, it's not that complex to implement in terms of pure code, but a simple & naive approach (counting the number of sold products when displaying the products page) would obviously kill the performances. So, must count successful orders in a dedicated table, and fetch these numbers at display time. I think most of the code can be put inside Act::Payment::get_prices()

> 2) Would you mind reminding me where to find instructions on how to involve YEF to handle the banking stuff? :)


I only know that you need to contact YEF treasurer (Philippe Bruhat) and arrange things with him. When he tells me it's ok, I enable the payment through YEF.


-- 
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.



More information about the Act mailing list