Exhibitor ticket
-
Hello,
I have started using Fast Events and am very satisfied with it for event admission tickets.
I was wondering if it is possible to create exhibitor tickets that can be scanned at the entrance, then again at the exit, and again at the entrance, and so on.
Thank you in advance.
-
There are two possible solutions.
Since version 2.4.0 of the plugin, there is an option to temporarily leave the event and return later. See https://docs.fast-events.eu/en/latest/usage/events.html#scan-keys So you perform an entry scan (level 1), then a level 7 scan (temporarily leaving), followed by a level 8 scan (re‑entering). The last two scans can be repeated indefinitely. This works out-of-the-box. The downside is that you need three scan positions, and the visitor must know that if they want to re‑enter a second time, they have to choose a different entrance. In other words, they shouldn’t use the entry scan again but instead use the level 8 (re‑entry) scan.
The second solution is a bit more complex, but it provides exactly what you want. Take a look at https://docs.fast-events.eu/en/latest/hooks/usage.html and https://docs.fast-events.eu/en/latest/hooks/scan_ticket.html You could use the following code. Note that this hasn’t been tested.
function your_action_scan_ticket( $attr, $scans ) {
global $wpdb;
if ( 9 === $attr['level'] ) {
$wpdb->update(
"{$wpdb->prefix}fe_event_qrcodes",
array(
'scan_date' => null,
'scan_location' => '',
'exit_scan' => 0,
),
array( 'qrcode' => $attr[‘qrcode’] )
);
}
}
add_action( 'fast_events_scan_ticket', 'your_action_scan_ticket', 10, 2 );With this snippet of code, immediately after the level 9 scan (exit) is performed, both the entry scan and the exit scan are removed again, allowing the visitor to re‑enter.
If you’re happy with the plugin, we’d appreciate it if you could leave a review.
Thanks a lot for your reply.
I tested the second solution. There is a small error in line 12 of the code: ‘qrcode’ (critical error) should be ‘qrcode’.
The second entry is possible, but at the second exit a message indicates that this operation (scan) has already been performed.Aha, yes of course—that’s because I haven’t tested it. The level 9 scan (exit) also needs to be removed from another table. You can add the following piece of code at the end of the function. This, too, hasn’t been tested by me ;-).
$wpdb->query("DELETE FROM {$wpdb->prefix}fe_event_entries WHERE qrcode_id in (SELECT id from {$wpdb->prefix}fe_event_qrcodes WHERE qrcode = $attr[‘qrcode’])");I’m sorry but here is the result. I have tried a lot but can’t find the solution.
Can’t send the image:
Parse error: syntax error, unexpected ”’ and so on
With $attr[qrcode] there is no error message : error comes with $attr[‘qrcode’]
A cut copy problem as I copied it from the docs. It uses quotation tics.
The issue is $attr[‘qrcode’] should be $attr[‘qrcode’]. Look very carefully at the quotes.
Funny, apparently this forum changes it to quotation marks.
Lets try it with inline code:
$attr[‘qrcode’] must be: $attr['qrcode']-
This reply was modified 6 months, 1 week ago by
Fast Events Support.
that is what I had done -> Parse Error.
With a blank $attr [‘qrcode’] between attr and [ there is no more error but the second exit is not possible. “Scan already done”We will look into it once we can access our test-environment again. Cloudflare is down: https://www.bbc.com/news/articles/c629pny4gl7o
Our test environment is protected by Cloudflare Zero trust and is not accessible at the moment.
Finally… Cloudflare is available again, and the code snippet has now been tested successfully.
function your_action_scan_ticket( $attr, $scans ) {
global $wpdb;
if ( 9 === $attr['level'] ) {
$wpdb->update(
"{$wpdb->prefix}fe_event_qrcodes",
array(
'scan_date' => null,
'scan_location' => '',
'exit_scan' => 0,
),
array( 'qrcode' => $attr['qrcode'] )
);
$wpdb->query(
$wpdb->prepare("DELETE FROM {$wpdb->prefix}fe_event_entries WHERE qrcode_id in (SELECT id " .
"from {$wpdb->prefix}fe_event_qrcodes WHERE qrcode = %s)", $attr['qrcode'] )
);
}
}
add_action( 'fast_events_scan_ticket', 'your_action_scan_ticket', 10, 2 );Now it works fine. Exactly what I need.
Thank you very much.
Good to hear.
We’re curious to hear how you use Fast Events so that visitors can enter multiple times. We can include your example in our documentation.
If you’re happy with the plugin, we’d appreciate it if you could leave a review.
-
This reply was modified 6 months, 1 week ago by
The topic ‘Exhibitor ticket’ is closed to new replies.