hi,
sorry but at the moment this is not yet possible and might need custom coding on your part to make this work.
You need to create a custom placeholder for that.
/* === Display User IP Address === */
function em_custom_placeholder_booking_ip($replacement, $EM_Booking, $result) {
if(is_object($EM_Booking)) {
if($result == '#_ccUserIP') {
if(!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; }
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; }
else { $ip = $_SERVER['REMOTE_ADDR']; }
$replacement = $ip;
}
}
return $replacement;
}
add_filter('em_event_output_placeholder', 'em_custom_placeholder_booking_ip', 1, 3 );
Then, if you want to display it on the booking form as well (you need to show what data you collect), add this to your ticket-single.php template file:
<div class="form-group">
<label><?php echo __('IP Address','stonehenge-theme'); ?></label>
<span><?php echo $EM_Event->output("#_ccUserIP"); ?></span>
</div>
This way you can use the #_ccUserIP placeholder anywhere in Events Manager, so in emails as well.
To see it in action: https://www.gidspatrick.nl/agenda/ (In Dutch, but you get the idea the booking form anyway, hehehe) 😉
Thread Starter
lapd
(@lapd)
Wow, that works!
I really appreciate your help.
And you have a good looking form on your website as well!
Regards,
Matej
Glad I could help, Matej. 🙂
And thanks.. Took me a while to get the styling just right (and responsive), but it was worth it. Especially getting the checkbox leeft of the label was quite a challenge. 😉