Support

Home Forums Event Espresso Premium Ticket Numbers

Ticket Numbers

Posted: January 17, 2014 at 11:54 am


Fred Sessoms

January 17, 2014 at 11:54 am

Can the UID number be replaced with our own 5 digit number, either randomly generated or serialized? If so, how? Thank you.


Dean

January 20, 2014 at 1:16 am

Hi Fred,

I assume you mean the Registration ID for each attendee? If so check out this thread – https://eventespresso.com/topic/custom-registration-id/


Fred Sessoms

January 26, 2014 at 2:02 pm

This solution is not working for me. In fact, it is creating error messages; “An Error Occurred, No ID”. Perhaps I am doing something wrong. All I want is a five digit random ticket number rather than what is generated by EE. I have added the blocks of code to functions.php as suggested here: https://eventespresso.com/topic/custom-registration-id/ and this is where the problems began – error messages. Can someone please give better instructions? Thank you.


Sidney Harrell

January 27, 2014 at 9:43 am

Try this code:

add_filter('filter_hook_espresso_registration_id', 'my_custom_registration_id', 10, 1);

function my_custom_registration_id(){
	$id = uniqid();
        // for the sake of an example, we'll convert the unique ID to be letters from the alphabet, which would make for something similar to an airline's reservation code
	return substr(strtr($id, 'abcdefghi', '01234567890j'), 0, 5);
}

// remove default registration id filter
function my_remove_registration_id_filter() {
	remove_filter('filter_hook_espresso_registration_id', 'espresso_build_registration_id', 10);
}
add_filter ('filter_hook_espresso_registration_id', 'my_remove_registration_id_filter', 9 );

Try adding this code to this blank plugin to hold the custom functions.


Fred Sessoms

January 27, 2014 at 9:50 am

Thank you, Sidney. I will try and let you know.


Fred Sessoms

January 27, 2014 at 2:34 pm

Perfect, Sidney! Works like a charm. Thank you very much.


Sidney Harrell

January 27, 2014 at 5:26 pm

Glad to help. 🙂

The support post ‘Ticket Numbers’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso