Change Ticket ID/# format (remove unique ID appended to end of Ticket #'s)

Home Forums Ticket Products Event Tickets Plus Change Ticket ID/# format (remove unique ID appended to end of Ticket #'s)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1570217
    marksalvadore
    Participant

    Hello,

    I’m trying to use this plugin to enable a client to sell raffle tickets on their website.

    I was initially having issues getting sequential ticket numbers to work. After some trail and error I found that using the Tribe Commerce option doesn’t allow for sequential numbers as it just grabs the next available post_id as the ticket number.

    I’ve since switched to using Woocommerce and the sequential numbering is working now. The issue I’m having is the ticket numbers have some type of unique id appended to them (see text marked in red on attached image).

    I’m afraid this will confuse my client and was wondering if there is a way to disable this unique id or remove it.

    To clarify I would like to go from ticket numbers being like this:
    RAFFLE-1-O98DM6
    RAFFLE-2-UMIPED
    RAFFLE-3-5X3CLQ
    RAFFLE-4-W7HNT5
    RAFFLE-5-YMONQA

    To this:
    RAFFLE-1
    RAFFLE-2
    RAFFLE-3
    RAFFLE-4
    RAFFLE-5

    #1570222
    marksalvadore
    Participant

    Just a quick follow up, I think I’ve solved the problem on my own.

    I hooked into the event_tickets_woocommerce_ticket_created action and modified the post meta that sets the ticket number.

    function modify_ticket_after_created($attendee_id){
    	$ticket_id = get_post_meta($attendee_id, '_unique_id', true);
    	$ticket_id = substr($ticket_id, 0, strrpos($ticket_id, '-'));
    	update_post_meta($attendee_id,'_unique_id', $ticket_id);
    }
    add_action('event_tickets_woocommerce_ticket_created', 'modify_ticket_after_created', 10, 1);
    #1570484
    Andras
    Keymaster

    Hello Mark,

    Thanks for using our plugins and welcome to the forums!

    Happy to hear you found a solution. Awesome job there mate!

    Please let me know if you need any further assistance with this, or if we can close this as resolved.

    Cheers,
    Andras

    #1586762
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Change Ticket ID/# format (remove unique ID appended to end of Ticket #'s)’ is closed to new replies.