Posted: 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? |
|
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. |
|
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 |
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:
|
|
|
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. My point is just to make the button on the table to display as “Expired” , instead of “Register”. Thanks |
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:
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. |
|
|
I have used the entire template code from github that you sent, but still shows the Register button instead of Expired. |
Can you link me to your events page please? |
|
|
sure. http://198.1.78.59/~cumbieandtrull/postlicensing/postlicensing-schedule The first event on the table is the Expired one. |
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 — |
|
|
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 |
|
Hi guys, i think i have figure it out. So I guess everything should be sorted now. Thanks |
Great! Was there anything else that we could help you with regarding the events table template add-on? — |
|
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.