Support

Home Forums Event Espresso Premium Remaining Datetimes

Remaining Datetimes

Posted: February 22, 2018 at 7:07 pm

Viewing 6 reply threads


lupineart

February 22, 2018 at 7:07 pm

Hey guys,

Is there a way to use shortcode to display the remaining datetimes?

Currently I’m using this: https://gist.github.com/joshfeck/777cc126964a25c15962f2c14aa3eb82

But that’s kind of hidden under the ticket selector and doesn’t break down the real availability (example – afternoon classes 3 left, evening 8 left). This is what I’d like: https://www.dropbox.com/s/f8op3cemswklccn/Screenshot%202018-02-22%2018.03.20.png?dl=0

Of course, I expect that I would have to identify a datetime it needs to pull the data from.

Failing that, is there a way to display the ee_print_number_of_tickets.php in a different location, ideally using it as shortcode?

Is this possible?

Thanks, Derek


Tony

  • Support Staff

February 23, 2018 at 7:28 am

Hi Derek,

Theres another example that breaks down each datetime here:

https://gist.github.com/Pebblo/3d019689d6c51a302eb95bbd3174b91e#file-example2-php

That is displayed just before the ticket selector, rather than below it.

Converting the Joshes example into a shortcode can be done but it’ll need more than just converting into a shortcode to do what you are requesting.


Josh

  • Support Staff

February 23, 2018 at 7:53 am

Or move the location:

https://gist.github.com/joshfeck/777cc126964a25c15962f2c14aa3eb82#file-ee_number_tickets_after_dates-php


lupineart

February 23, 2018 at 6:37 pm

OK, thanks guys.

What I meant by converting to shortcode was doing just that, not using that as a way to do what I was trying to achieve as a first choice.

So could this code JOsh provided:

https://gist.github.com/joshfeck/777cc126964a25c15962f2c14aa3eb82#file-ee_number_tickets_after_dates-php

be converted to shortcode? If I ‘m going to go this way, I need to control which events it is showed in, so was going to use shortcode for that.

Some events have as many as 18 datetimes, so it doesn’t look good to display all of those in 1 big list. I would prefer to use the function on events with just 1 datetime for the time being.

Thanks, Derek


Tony

  • Support Staff

February 26, 2018 at 6:42 am

What I meant by converting to shortcode was doing just that, not using that as a way to do what I was trying to achieve as a first choice.

Sorry but I’m not sure I follow this. You want it converting to a shortcode to not do what you are asking as a first choice?

So could this code JOsh provided… be converted to shortcode?

Yes the code you linked to can be converted to a shortcode:

https://gist.github.com/Pebblo/f07d5515180b363864160d90ca41ec0f

Use that within an event to output the same as it does already, you can also add an event_id=X attribute to the shortcode if its for a specific event in a post/page (so not an EE event post).

However note that snippets and examples we provide here are unsupported.


lupineart

February 26, 2018 at 10:43 pm

Excellent, thanks!


Tony

  • Support Staff

February 27, 2018 at 3:14 am

You’re most welcome 🙂

Viewing 6 reply threads

The support post ‘Remaining Datetimes’ 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