Support

Home Forums Event Espresso Premium [ESPRESSO_MY_EVENTS] customization

[ESPRESSO_MY_EVENTS] customization

Posted: February 19, 2018 at 11:13 am

Viewing 6 reply threads


ardiaful

February 19, 2018 at 11:13 am

In my_events table, inside the date times column, I need to show only the date of the ticket purchased, and not the to/from dates for each event.

Example: An event is created with two dates January 1st 9:00 and January 15th 9:00. A user purchases a ticket for the Jan 15th 9:00 date time. However, inside my_events table it is shown the to/from date times of the event: Jan 1st 9:00- Jan 15th 9:00.

I would like to show only the Jan 15th 9:00 date time. Thanks


ardiaful

February 19, 2018 at 11:40 am

<?php echo apply_filters(
										'FHEE__content-espresso_my_events__table_header_end_date',
										esc_html__( 'Dates & Times', 'event_espresso' ),
										$event
									); ?>


Josh

  • Support Staff

February 19, 2018 at 4:52 pm

Hi there,

You can copy over the my events templates over to your WordPress theme, then make the following edits:

In content-espresso_my_events-event_section.template.php line 30 change:
<?php espresso_event_date_range('', '', '', '', $event->ID()); ?>

to be:

<?php $reg = reset($registrations);
$datetime = $reg->get_latest_related_datetime();
echo $datetime instanceof EE_Datetime ? $datetime->start_date_and_time() : ''; 
?>


ardiaful

February 20, 2018 at 4:45 am

Thanks Josh, this works! let me ask you two more things:

– Need to translate months in the start_date_and_time() column
– Need to show the start date and time here `<th scope=”col” class=”espresso-my-events-datetimes-th”>
<?php echo apply_filters(
‘FHEE__content-espresso_my_events__table_header_datetimes’,
esc_html__( ‘Dates & Times’, ‘event_espresso’ ),
$event
); ?>
</th>`


ardiaful

February 20, 2018 at 4:51 am

Months names are translated in my .po file and uploaded with .mo here:
wp-content/uploads/espresso/languages


Josh

  • Support Staff

February 21, 2018 at 1:24 pm

You’ll change what you changed in the above to:

<?php $reg = reset($registrations);
$datetime = $reg->get_latest_related_datetime();
echo $datetime instanceof EE_Datetime ? 
    date_i18n(get_option('date_format') . ' ' . get_option('time_format'), 
    strtotime($datetime->start_date_and_time())) :
 ''; 
?>

Then, in content-espresso_my_events-event_section_tickets.template.php on line 16 you’ll change:

<?php echo $ticket instanceof EE_Ticket ? $ticket->date_range() : ''; ?>

to be:

<?php echo $ticket instanceof EE_Ticket ? date_i18n(get_option('date_format') . ' ' . get_option('time_format'), 
    strtotime($ticket->first_datetime()->get('DTT_EVT_start'))) : ''; ?>


ardiaful

February 22, 2018 at 6:53 am

Thank you, that worked just fine.

Viewing 6 reply threads

The support post ‘[ESPRESSO_MY_EVENTS] customization’ 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