Support

Home Forums Event Espresso Premium Expired Button for Events Table

Expired Button for Events Table

Posted: July 31, 2015 at 4:59 am

Viewing 12 reply threads


Daniel Ballard

July 31, 2015 at 4:59 am

Hi,

Is there a way i can set Expired or Closed button for the Events Table plugin for EE 4?


Dean

July 31, 2015 at 5:48 am

Hi,

The only way to do it would be to copy the /wp-content/plugins/eea-events-table-view-template/templates/espresso-events-table-template.template.php over to /wp-content/uploads/espresso/templates/espresso-events-table-template.template.php and then edit the template.

Here is an example: http://pastebin.com/Fqa7sigc

See how I added in the $exp_button_text (line 12) and the check for it (line 101-103)?

Please note the above is just an example, designed to help you create your own custom template and is not supported nor will it be maintained.


Daniel Ballard

August 4, 2015 at 6:02 am

Hi Dean,

Thanks for your reply.

I have tested your code snippets and applied it on my site, what happens is it will set the 2nd event up to the last as Expired. Please check the screenshot below.

Thanks


Tony

  • Support Staff

August 4, 2015 at 6:25 am

Is the first event an ‘active’ event? As in today’s date is between the event start and event end date.

Change the if statement from line 101 – 103 to this:

if ( $event->is_expired() ) {
	$live_button	= '<a id="a_register_link-'.$post->ID.'" class="a_register_link_sold_out" href="'.$registration_url.'">'.$exp_button_text.'</a>';
}
  • This reply was modified 9 years, 3 months ago by Tony. Reason: formatting


Daniel Ballard

August 4, 2015 at 7:55 am

Hi Tony,

I’ve tried your code, added it online 101-103 and removed the $event->is_upcoming() part, there’s no changes on the result.

The expired event is an event that the Ticket Sale Dates are done.
Sold out tickets are event that tickets are sold out.

My point is just to make the button on the table to display as “Expired” , instead of “Register”.

Thanks


Tony

  • Support Staff

August 4, 2015 at 8:18 am

Here is how that code looks on my site – http://take.ms/sDyK5

Notice the correct text is output for the correct event, that is using the shortcode:

[ESPRESSO_EVENTS_TABLE_TEMPLATE show_expired=true category_slug="all-event-status"]

Here is the template I am using that show the same code check for is_expired() although the variables are slightly different:

https://gist.github.com/Pebblo/0222dbc44b0802691429

It looks like you are setting the link text from outside the_loop so its used for all of the events. You’ll need to examine your code and compare it with the code above to see whats causing the problem.


Daniel Ballard

August 4, 2015 at 8:30 am

I have used the entire template code from github that you sent, but still shows the Register button instead of Expired.
I’m really confused why it won’t recognize the is_expired() function.


Tony

  • Support Staff

August 4, 2015 at 8:43 am

Can you link me to your events page please?


Daniel Ballard

August 4, 2015 at 8:57 am

sure.

http://198.1.78.59/~cumbieandtrull/postlicensing/postlicensing-schedule

The first event on the table is the Expired one.


Lorenzo Orlando Caum

  • Support Staff

August 4, 2015 at 9:32 am

Hi Daniel,

It looks like the event is active due to the following date range:

08/03/2015 – 09/19/2015

Does the event show as expired when viewing it in the event editor or active?

Here are some examples:

Expired: http://cl.ly/image/3U0D2s253540
Active: http://cl.ly/image/2o280h2D1M1z


Lorenzo


Daniel Ballard

August 4, 2015 at 9:39 am

Hi Lorenzo,

This is the details for the first event. Click on the first event, the Register button, and you’ll notice the Qty shows Expired.

Ticket Sale Dates
– The dates when this ticket is available for purchase.
Goes On Sale:Wednesday July 1st, 2015 10:40 am
Sales End:Sunday August 2nd, 2015 12:00 am


Daniel Ballard

August 4, 2015 at 9:44 am

Hi guys, i think i have figure it out.
Button Expired shows up now, when i’ve updated the End Date of the Event.
What I was thinking earlier is it will show as Expired when the ticket sale ends.

So I guess everything should be sorted now.

Thanks


Lorenzo Orlando Caum

  • Support Staff

August 4, 2015 at 11:03 am

Great! Was there anything else that we could help you with regarding the events table template add-on?


Lorenzo

Viewing 12 reply threads

The support post ‘Expired Button for Events Table’ 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