Posted: November 18, 2015 at 3:29 pm
|
Using latest version of everything. On the people pages, like this: their list of events also includes SoldOut & Expired events. How can we limit this list to only classes that are Upcoming or Active? |
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? |
|
|
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. |
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:
Remove “EED_People_Single::$templates_path .” from the locate_template call, so its like this:
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. |
|
|
I will just wait until the next update. Any estimate on this? |
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. |
|
|
Thank you for your help Tony. I will be on the lookout. |
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.