WordPress / wordcamp.org

WordCamps are casual, locally-organized conferences covering everything related to WordPress.
https://wordcamp.org
132 stars 74 forks source link

Limit number of tickets per transaction #1361

Open dd32 opened 3 months ago

dd32 commented 3 months ago

Sometimes there's a need to limit the number of tickets per transaction.

It would be ideal if Camptix allowed for a "maximum tickets per transaction" option per ticket / reservation / coupon / event. This may not prevent someone purchasing multiple tickets in multiple transactions, but would be useful in certain circumstances.

This could be very useful for Speaker tickets / coupons, where a generic coupon/reservation is shared with speakers, with the intention of them claiming one-per-speaker, but seeing they can claim multiple leads to additional plus ones.

Other events may be special, and intended on every attendee having a singular ticket (Community Summit for example).

This came up on Slack today: https://wordpress.slack.com/archives/C08M59V3P/p1724266664412339

It turns out we have some code to do this, to limit it to 1 per transaction for specific sites: https://github.com/WordPress/wordcamp.org/blob/dfe9fe708c67aff655fca717ffe600d2cb4a47ff/public_html/wp-content/mu-plugins/camptix-tweaks/camptix-tweaks.php#L997-L1015

See also; #740 and #1305

lumicliment commented 3 months ago

+1 I fully support the addition of this option. In our event we have encountered this problem, and although thanks to @dd32 we have solved it with CSS, it is not an elegant or easy option for non-programmers.

pkevan commented 3 months ago

just scanning the code, I imagine there is edge cases to consider (such as the camptix_max_tickets_per_order_after_coupon_bypass filter), but does seems like a good idea - presumably it's only ever been a filter in code due to these complexities in the code.

nilovelez commented 3 months ago

It would be interesting to add this as a per-ticket-type option.

For example allow the 10 usual tickets for regular tickets, but only 1 for microsponsors