Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit number of tickets per transaction #1361

Open
dd32 opened this issue Aug 22, 2024 · 3 comments
Open

Limit number of tickets per transaction #1361

dd32 opened this issue Aug 22, 2024 · 3 comments

Comments

@dd32
Copy link
Member

dd32 commented Aug 22, 2024

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:

/**
* Restrict the max number of tickets per order to one for specific site(s).
*
* @param int $max Default ticket maximum.
* @return int Maybe updated max ticket amount.
*/
function limit_one_ticket_per_order( $max ) {
$limited_sites = array(
1056, // testing.wordcamp.org/2019.
1415, // communitysummit.wordcamp.org/2023.
);
$current_site_id = get_current_blog_id();
if ( in_array( $current_site_id, $limited_sites, true ) ) {
return 1;
}
return $max;
}

See also; #740 and #1305

@lumicliment
Copy link

+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
Copy link
Contributor

pkevan commented Aug 22, 2024

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants