Hey everyone! If the latest round of LearnPress/BuddyPress/WordPress updates broke this plugin for you and caused Fatal error: Uncaught Error: Call to a member function get_id() on line 93 of course.php, I have a temporary patch that might work for you. You can either replace the code in plugins/learnpress-buddypress/templates/profile/courses.php with the following or copy it to your theme by creating a new courses.php file in “wp-content/themes/(yourtheme)/learnpress/addons/buddypress/profile
<?php
/**
* Template for displaying BuddyPress profile courses page.
*
* This template can be overridden by copying it to yourtheme/learnpress/addons/buddypress/profile/courses.php.
*
* @author ThimPress
* @package LearnPress/BuddyPress/Templates
* @version 3.0.0
*/
/**
* Prevent loading this file directly
*/
defined( 'ABSPATH' ) || exit();
?>
<?php
$limit = apply_filters( 'learn_press_profile_tab_courses_all_limit',
LP()->settings->get( 'profile_courses_limit', 10 ) );
if ( version_compare( LEARNPRESS_VERSION, '4.0.0-beta-0', '>' ) ) {
$limit = apply_filters( 'learn_press_profile_tab_courses_all_limit',
LP_Settings::get_option( 'archive_course_limit' ) );
}
$profile = learn_press_get_profile();
$query = isset( $_REQUEST['filter'] ) ? $_REQUEST['filter'] : 'own';
$filters = array(
'own' => __( 'Own', 'learnpress-buddypress' ),
'purchased' => __( 'Purchased', 'learnpress-buddypress' )
); ?>
<ul class="leanpress-buddpress-list-filters">
<?php foreach ( $filters as $key => $filter ) { ?>
<li>
<a href="<?php echo add_query_arg( array( 'filter' => $key ) ); ?>"
class="<?php echo ( $query == $key ) ? 'active' : ''; ?>"><?php echo $filter; ?></a>
</li>
<?php } ?>
</ul>
<?php
$paged = 1;
if ( isset( $_REQUEST['paged'] ) ) {
$paged = LP_Helper::sanitize_params_submitted( $_REQUEST['paged'] );
}
$courses = $profile->query_courses( $query, array( 'status' => '', 'paged' => $paged ) );
?>
<?php
if ( $query == 'own' ) {
if ( ! $courses['total'] ) {
learn_press_display_message( __( 'You haven\'t got any courses yet!', 'learnpress-buddypress' ) );
} else {
$num_pages = learn_press_get_num_pages( $courses['total'], $limit );
?>
<ul class="learn-press-courses profile-courses-list">
<?php
global $post;
foreach ( $courses['items'] as $item ) {
$course = learn_press_get_course( $item );
$post = get_post( $item );
setup_postdata( $post );
learn_press_get_template( 'content-course.php' );
}
wp_reset_postdata();
?>
</ul>
<?php learn_press_buddypress_paging_nav( array( 'num_pages' => $num_pages ) ); ?>
<?php }
} elseif ( $query == 'purchased' ) {
if ( $courses['items'] ) {
?>
<table class="lp-list-table profile-list-courses profile-list-table">
<thead>
<tr>
<th class="column-course"><?php _e( 'Course', 'learnpress' ); ?></th>
<th class="column-date"><?php _e( 'Date', 'learnpress' ); ?></th>
<th class="column-passing-grade"><?php _e( 'Passing Grade', 'learnpress' ); ?></th>
<th class="column-status"><?php _e( 'Progress', 'learnpress' ); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ( $courses['items'] as $user_course ) { ?>
<?php
/**
* @var $user_course LP_User_Item_Course
*/
$course = learn_press_get_course( $user_course );
$course_data = $user->get_course_data( $user_course );?>
<tr>
<td class="column-course">
<a href="<?php echo $course->get_permalink(); ?>">
<?php echo $course->get_title(); ?>
</a>
</td>
<td class="column-date"><?php echo $course_data->get_start_time( 'd M Y' ); ?></td>
<td class="column-passing-grade"><?php echo $course->get_passing_condition( true ); ?></td>
<td class="column-status">
<?php if ( $course_data->get_results( 'status' ) !== 'purchased' ) { ?>
<span class="result-percent"><?php echo $course_data->get_percent_result(); ?></span>
<span
class="lp-label label-<?php echo esc_attr( $course_data->get_results( 'status' ) ); ?>">
<?php //echo $course_data->get_status_label( $course_data->get_results( 'status' ) ); ?>
</span>
<?php } else { ?>
<span
class="lp-label label-<?php echo esc_attr( $course_data->get_results( 'status' ) ); ?>">
<?php //echo $course_data->get_status_label( $course_data->get_results( 'status' ) ); ?>
</span>
<?php } ?>
</td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr class="list-table-nav">
<td colspan="2" class="nav-text">
<?php echo $courses->get_offset_text(); ?>
</td>
<td colspan="2" class="nav-pages">
<?php $courses->get_nav_numbers( true ); ?>
</td>
</tr>
</tfoot>
</table>
<?php
} else {
learn_press_display_message( __( 'No courses!', 'learnpress-buddypress' ) );
}
} ?>
Hope this helps someone ??
]]>Hi,
We’re currently experiencing this Fatal error when we head over to “Purchased” tab of the user dashboard.
Kindly check and advise necessary updates.
Fatal error: Uncaught Error: Call to a member function get_id() on string in /home/customer/www/..../public_html/wp-content/plugins/learnpress-buddypress/templates/profile/courses.php:93 Stack trace: #0 /home/customer/www/..../public_html/wp-content/plugins/learnpress/inc/lp-template-functions.php(929): include() #1 /home/customer/www/..../public_html/wp-content/plugins/learnpress-buddypress/inc/load.php(286): learn_press_get_template('profile/courses...', Array, 'learnpress/addo...', '/home/customer/...') #2 /home/customer/www/..../public_html/wp-includes/class-wp-hook.php(307): LP_Addon_BuddyPress->bp_tab_courses_content('') #3 /home/customer/www/..../public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array) #4 /home/customer/www/..../public_html/wp-includes/plugin.php(474): WP_Hook->do_action(Array) #5 /home/customer/www/..../public_html/wp-content/plugins/buddypress/bp-templates/bp-nouveau/i in /home/customer/www/..../public_html/wp-content/plugins/learnpress-buddypress/templates/profile/courses.php on line 93
Thanks!
]]>Hello,
What sort of integeration does this addon exactly have with BuddyPress???
I was hoping to see courses either available on the BP groups or something. Right now I’m not even sure what benefit this plugin provides. Kindly provde a detailed write-up of this plugin benefits and how to go about activating them?
Kind Regards,
]]>Dear Learnpress Buddypress,
Upon installing Buddypress and bbpress, this is how the page of the Activity looks like. Why does it look so ugly [1] https://ibb.co/xsBtK27?
Why can I have this look [2] https://ibb.co/XDxYrx3 instead?
Is this [1] a newest version? is there anyway to improve the default looks?
Thank you. Look forward to hearing from you soon.
Regards,
Josh
No courses appear in buddypress menu
Hello guys,
I made the integration between Learnpress and Budypress with this plugin.
However, when I click on the course menu, no course appears.
Appears for admin only.
Can you help me please.
I would like students to view courses when they click on the course menu.
]]>Hello,
What is the best practice methods to integrate and install BuddyPress with Learnpress. I am using a Self-Hosted wordpress website with Learnpress plugin, the latest version (I updated it again yesterday).
I currently have set my onlinecourse website up and running, it is a LIVE site. But I dont think it′s working, from a student/user experience perspective, the way I whant it to do.
Students get a bit confused when paying for a course and then can not easily find the course they payed – AFTER I manually accept them and activate them as students. (When I see the payment have been done).
My Question is: which is the Best Practice and which are the settings that I simply Have to do, to make this work smoothly.
Here an explanation on what I have installed.
Should I stop to manually adding them, and simply allow access when payed for course?
1) I installed Learnpress Plugin to a wordpress site – and I am using a wordpress theme from KadenceTheme. Works OK
2) I followed the ThimPress website tutorial.
3) I activated, made the settings for Learnpress Payment gateway to work, and it did. Works OK with Learnpress integrated payment.
But I still chose to use WooCommerce. And PayPal.
I dont whant students to be coming to my wordpress Adminpage when paying and logging in. So therefore –
4) I installed Buddypress to create a forum – Works OK but I feel I am doing something wrong. What is the Best Practice?
5) Installed bbpress for students to see their payed course (But its not instantly viewable) What is the Best Practice?
6) I installed activated WooCommerce – and I used the recommended plugin to work with Laernpress. – Works OK, but I manually ccept students, and I feel I am doing something wrong. What is the Best Practice?
]]>If there are more than ten courses or tasks in account, pages are formed. But when going to the next page, it gives a 404 error. How to solve a problem?
]]>All I need is a gradebook for existing parents to create for existing students. Not an entire course plugin. Will your plugin/add-on achieve this?
]]>Good day
Is there any hope that this plugin will be updated to the current version of WP?
Thank you for your early reply
Richard
Seems the plugin has the proper domain but there are no language files, therefore can’t be translated in polyglots. Can you add the language files so we can translate it. I can add the files to my installation but will be overriden by updates.
Also, there is no visible github repository I can make a pull request to.
]]>I’m using LearnPress, BuddyPress and LearnPress – BuddyPress Integration for my online learning platform.
On the frontend, there is “Own Courses” in the courses tab on the BuddyPress menu. But I don’t want my customers to be able too become a teacher and build courses so there won’t be any.
How do I remove that tab/filter, so if the customer clicks courses, he immediately sees the courses he purchased?
Best would be if it doesn’t even say “Purchased”, instead the students should click on “Courses” and see them straight.
Possible?
Best regards,
Leni
Now when a visitor click the “enroll” button, the visitor will be redirected to the default login button of wordpress.
Is it possible to customize register and login button?
By the way, for a free course, is it possible to
1:If A is a user who have logged in, he can enroll free course and track the progress.
2:If B is a visitor who doesn’t login, he can still learn the Courses without enrolling.But since he didn’t login, he can’t track his progress.
]]>Goodmorning
I need to know one thing.
Can I satisfy my need to host on my site through the teachers plugin who are physically in other cities?
thank you very much
Max
]]>So we removed from courses from some students.
And the courses still shows in their purchased section within BuddyPress.
They don’t have access, as we changed the order to cancel.
BUT – its shows they still purchased.
How can we fix this?
]]>This plugins is not properly prepared for translation according to polyglots. Can this be improved_
Thanks for the awesome plugins
]]>Hi,
Facing a problem with BuddyPress plugin(WP 5.2.2 – BuddyPress 4.3.0), on site there are groups and when new members are added to any group (public, private or hidden), newly added members are unable to access group page and are redirected site home page. However old members in groups are able to access group page and perform all functions.
Hi there!
I’ve a page with Learnpress and Buddypress Integration, i have the login page from learnpress (i like this login), and i want to redirect the login to the buddypress profile page (now it redirects to learnpress profile, and it’s like crap), but i can’t use a static page because buddypress have the URL like ‘members/username/profile’ so i can’t redirect it via URL because the ‘username’ change always..
Any idea? I’m tired of search in google or in the settings to change the redirect page.. i think that the only way is changing the code.
Thanks!
Federico.
I am trying to customize the template files, (particularly the courses.php file), but when I place the file in the /learnpress/addons/buddypress/profile/ folder within my child theme, it doesn’t work. This is the location that is listed in the documentation for the courses.php file. Is this documentation outdated?
]]>Tab for courses, quizzes and orders are not translated in buddypress profile.
Po files and slugs are correctly translated, but tab is not !
Could you please help me ?
Many thanks.
Hey! Thanks so much for this great plugin. It`s very useful.
Please, is there a way to show Learnpress Certificates in the BuddyPress profile? Everything else is fine but for as long as a student remains unable to locate their certificate then it`s a huge challenge
]]>Hi guys,
I’m using BuddyPress version 2.7.4, LearnPress 2.1.4.2, and the LearnPress BP integration version 2.0. The problem is, when I visit the Courses tab in my BP profile, all of the tab content is empty. And there is no content in any of the sub-tabs either.
I would really appreciate your help in getting this working, because LearnPress is awesome! And I’m looking forward to integrating it with BuddyPress.
Thanks
]]>1. How can we make a setting that whenever a new learnpress course is added a corresponding buddypress group is also added automatically?
2. How can we synchronise a learnpress course with a buddypress group such that all subscribers of a course are automatically a member of the corresponding group?
]]>?
]]>I insert the api key and when try register a course open sanbox. Please help
]]>my profile page is not changed in any way that shows learn press profile .
and i also check the profile page of buddypress . i think that should shows the cources and all things of wordpress but that shows only tabs given by buddy press . So my question is that what is the work of this app i need the integration of buddypress profile page and wp-learpress profile > any one can hel me out