Support

Home Forums Event Espresso Premium People-Addon, Pages listing Expired & Sold Out classes (EE4)

People-Addon, Pages listing Expired & Sold Out classes (EE4)

Posted: November 18, 2015 at 3:29 pm


Donna

November 18, 2015 at 3:29 pm

Using latest version of everything.

On the people pages, like this:
http://smartypaws.com/people/donna-foreman

their list of events also includes SoldOut & Expired events.

How can we limit this list to only classes that are Upcoming or Active?


Tony

  • Support Staff

November 19, 2015 at 11:32 am

Hi Donna,

Currently the people add-on does not allow you to filter events based on status, to do that you will need to load a custom template that checks the status of the events and skips outputting the link to the event if it has expired or is sold out.

Are you comfortable with HTML, PHP and FTP?


Donna

November 19, 2015 at 11:44 am

This is actually Joe her web admin.

Yes, if you get me some instructions on how to modify this specific template, along with the proper SQL query to do so I can get it done.


Tony

  • Support Staff

November 19, 2015 at 1:50 pm

Rather than writing custom queries for this, which is possible if you prefer to do that yourself, you can simply check within the loops for the events if the event is (active || UPCOMING) && NOT SOLD_OUT, if it is display the event, otherwise do not.

You can do this by modifying the template used to output the details:

The default template is \eea-people-addon\public\templates\content-espresso_people-details.php

Copy that template into your theme (or child theme) and modfiy the template there, here is an example of how to do the above:

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

However, there is one problem with this from within the people add-on itself, the template can’t be overridden with the code as it is now.

You’ll need to modify the core plugin to allow custom templates to load, within:

\eea-people-addon\EED_People_Single.module.php

Line 135 should have this:

$content .= EEH_Template::locate_template( EED_People_Single::$templates_path . 'content-espresso_people-details.php' );

Remove “EED_People_Single::$templates_path .” from the locate_template call, so its like this:

$content .= EEH_Template::locate_template( 'content-espresso_people-details.php' );

The custom template will then load in place of the current version. We generally do not recommend modifying the core plugin files but this change will be included within the next version of the people add-on and so will this is exception to that rule.


Donna

November 19, 2015 at 11:28 pm

I will just wait until the next update.

Any estimate on this?


Tony

  • Support Staff

November 20, 2015 at 3:43 am

The code change has been sent to review, if a approved then we will run it through testing to confirm it all works as expected and then the update pushed live.

We don’t push updates over the weekend so this will likely be included early next week.


Donna

November 20, 2015 at 10:29 am

Thank you for your help Tony. I will be on the lookout.


Tony

  • Support Staff

November 20, 2015 at 10:37 am

You’re most welcome, Joe.

Just let me know if you have any problems.

The support post ‘People-Addon, Pages listing Expired & Sold Out classes (EE4)’ 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