Support

Home Forums Event Espresso Premium Remove end times from ticket selector

Remove end times from ticket selector

Posted: February 1, 2016 at 11:18 am

Viewing 7 reply threads


calex

February 1, 2016 at 11:18 am

Hi,
I have an event with multi occurances within it and I want to alter some of the details displayed on the front end.

Is it possible to remove the event end times from within the ticket selector details?

I could not see a css class for this as the element wraps both start and end times.

Thanks


Lorenzo Orlando Caum

  • Support Staff

February 2, 2016 at 9:37 am

Hi Calex,

I can check into that to see if there are some CSS classes that can be targeted.

Could you share a screenshot (https://eventespresso.com/wiki/troubleshooting-checklist/#screenshots) of the area that you are referring to? For example, is this the information that is shown when you click on the details link for a specific ticket option?


Lorenzo


calex

February 2, 2016 at 1:22 pm

Lorenzo,
I’m not sure css will do this one as the element wraps all – feel free to surprise me – maybe some clever jQuery but otherwise a hook will do it.

Cheers
Alex

html


Lorenzo Orlando Caum

  • Support Staff

February 2, 2016 at 3:09 pm

Hi, that spot doesn’t have different classes for the different elements. However, it is possible to load your own version of the ticket selector:

//* Set Event Espresso to look for the ticket selector template in the espresso templates folder within the uploads folder for WordPress
add_filter ('FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', 'ee_custom_ticket_selector_template_location');

function ee_custom_ticket_selector_template_location(){
    return WP_CONTENT_DIR . '/uploads/espresso/templates/ticket_selector_chart.template.php';
}

You could load your own version that has CSS classes added and then selectively hide those elements for certain events.


Lorenzo


calex

February 15, 2016 at 4:48 pm

Lorenzo,
I have located and loaded the custom ticket selector as you show above.
An issue:
The bit that displays the time is <?php echo $datetime->time_range( $time_format, __( ‘ to ‘, ‘event_espresso’ )); ?> How can add tags to seperate the start and end times?
Thanks


Tony

  • Support Staff

February 16, 2016 at 4:45 am

If you going to load your own templates I would recommend against using /wp-content/uploads/ to store templates if possible, some security plugins really don’t like .php files being saved there and will just empty the contents of the file. Which means that anything setup to use the template will continue to ‘work’ but display nothing (as the template loads but there’s nothing in it).

I would use get_stylesheet_directory() to build a path to a child theme and place the template there.

As for the times you’ll need to build out your own times and not use the datetimes time_range() method. The EE_Datetime object has other methods you can use such as start_time(), end_time() etc so you can output just the start time using:

echo $datetime->start_time();

If you install a plugin such as Kint Debugger you can wrap the datetime in d(); to get a nice readable output of all properties and method available on a variable. For example just above that line use:

d($datetime);

Then view the ticket selector to see what you have available.


calex

February 16, 2016 at 10:34 am

Tony & Lorenzo thanks for your help and solutions.

I managed to output the start time as desired using the echo $datetime->start_time();

Tony, I will have to remember the Kint Debugger plugin – it looks cool and it would help me a lot in the future.

Cheers.


Tony

  • Support Staff

February 16, 2016 at 3:48 pm

Tony, I will have to remember the Kint Debugger plugin – it looks cool and it would help me a lot in the future.

I’m glad you like it, theres a few things you can do with it to help.

Take a look here for more info:

http://raveren.github.io/kint/

Any other problems just let us know.

Viewing 7 reply threads

The support post ‘Remove end times from ticket selector’ 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