Support

Home Forums Event Espresso Premium EE4 – Ticket add meta field and display it on back-end

EE4 – Ticket add meta field and display it on back-end

Posted: September 25, 2017 at 7:04 am

Viewing 3 reply threads


JacquesMivi

September 25, 2017 at 7:04 am

Hi there,

Do you have snippets to add/edit extra meta data on ticket table ?

Thanks a lot,


JacquesMivi

September 25, 2017 at 7:20 am

I have try to follow this post but without success
https://eventespresso.com/topic/adding-a-custom-field-in-event-tickets-datetimes/

Here is my code

//This is used to display the value of the SKU
add_filter( 'FHEE__espresso_events_Pricing_Hooks___get_ticket_row__template_args', 'es_display_tkt_SKU', 10, 7 );
function es_display_tkt_SKU( $template_args, $tktrow, $ticket, $ticket_datetimes, $all_dtts, $default, $all_tickets ) {
$TKT_ID = $template_args[ 'TKT_ID' ];
$ticket = EEM_Ticket::instance()->get_one_by_ID( $TKT_ID );
if ( $ticket instanceof EE_Ticket ) {
$template_args[ 'TKT_SKU' ] = "12";
}

return $template_args;
}


Tony

  • Support Staff

September 26, 2017 at 1:53 am

That would add a TKT_SKU value to $template_args but you’d need to use that somewhere, EE will not output it automatically.

Another user has previously created ‘Admin Only’ tickets using ticket meta which may give you an idea on how to do this, take a look:

https://github.com/chasecmiller/EE4-AdminOnlyTicket

Does that help?


JacquesMivi

September 28, 2017 at 8:14 am

Ok I will dig into this code.

Thanks

Viewing 3 reply threads

The support post ‘EE4 – Ticket add meta field and display it on back-end’ 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