BuddyBoss Home – Web › Support Forums › Solutions › Social Learner › Course Register Button
- This topic has 20 replies, 3 contibutors, and was last updated 8 years, 11 months ago by Anonymous.
Question
November 20, 2015 at 6:05 pm #52359@anas-aljefryHello,
The Register Button on the course page for non-logged in users links to http://example.com/my-courses/ instead of the BP register page.
I used the code that was provided by @tjchester on this page (http://goo.gl/c6vSbt) but the register button points to my-course page.
add_action( 'sensei_course_meta', 'sl_nowc_sensei_course_meta_pre', 9 ); add_action( 'sensei_course_meta', 'sl_nowc_sensei_course_meta_post', 11 ); function sl_nowc_sensei_course_meta_pre(){ /** * If wocommerce is not active and user is not logged in, * sensei prints a button 'Register' which links to /my-course page instead of buddypress register page. * Lets make that point to buddypress register page. */ if( !is_user_logged_in() && function_exists( 'buddypress' ) && get_option( 'users_can_register') ){ if( class_exists( 'WooThemes_Sensei_Utils' ) && !WooThemes_Sensei_Utils::sensei_is_woocommerce_activated() ){ add_filter( 'page_link', 'sl_nowc_guest_mycourses_permalink', 99, 2 ); } } } function sl_nowc_sensei_course_meta_post(){ remove_filter( 'page_link', 'sl_nowc_guest_mycourses_permalink', 99, 2 ); } function sl_nowc_guest_mycourses_permalink( $link, $post_id ){ global $woothemes_sensei; $my_courses_page_id = ''; $settings = $woothemes_sensei->settings->get_settings(); if( isset( $settings[ 'my_course_page' ] ) && 0 < intval( $settings[ 'my_course_page' ] ) ){ $my_courses_page_id = $settings[ 'my_course_page' ]; } if( !empty( $my_courses_page_id ) && $my_courses_page_id==$post_id ){ //this is our page, lets change its url remove_filter( 'page_link', 'sl_nowc_guest_mycourses_permalink', 99, 2 ); $link = bp_get_signup_page(); } return $link; }
I’m using the latest version boss theme and social learner 1.0.6.
BR
Answers
November 21, 2015 at 6:35 am #52377@
AnonymousHi @anas-aljefry, This code is for Sensei not for Learndash. Please let me know you issue so we can assist you properly.
Best
PallaviNovember 21, 2015 at 10:42 am #52386@anas-aljefryHello @pallavi,
Yes, I’m aware of that. I’m using the sensei plugin.
BR
November 24, 2015 at 9:26 am #52614@anas-aljefryHello @pallavi,
Any update?
November 25, 2015 at 12:42 am #52688@
AnonymousHello @anas-aljefry, We have cross checked at our end and its working fine please make sure you have added this code inside the social learner child theme’s function.php
Regards
PallaviDecember 4, 2015 at 6:44 pm #53726@anas-aljefryHello @pallavi,
I did test the code again and again without any success and now I have a problem with the registration process.
When a user signs up via the buddypress register page, the user has to be approved by the admin.But when a user register via the sensei register page (which he/she can access by clicking the register button on a course page), he/she receives these warnings and the registration process is complete (no need to approve the user)
Warning: array_pop() expects parameter 1 to be array, object given in /home/content/p3pnexwpnas09_data02/62/2780262/html/wp-content/plugins/buddypress/bp-members/bp-members-functions.php on line 2708
Warning: array_pop() expects parameter 1 to be array, object given in /home/content/p3pnexwpnas09_data02/62/2780262/html/wp-content/plugins/buddypress/bp-members/bp-members-functions.php on line 2708
Warning: Cannot modify header information – headers already sent by (output started at /home/content/p3pnexwpnas09_data02/62/2780262/html/wp-content/plugins/buddypress/bp-members/bp-members-functions.php:2708) in /home/content/p3pnexwpnas09_data02/62/2780262/html/wp-includes/pluggable.php on line 935
Warning: Cannot modify header information – headers already sent by (output started at /home/content/p3pnexwpnas09_data02/62/2780262/html/wp-content/plugins/buddypress/bp-members/bp-members-functions.php:2708) in /home/content/p3pnexwpnas09_data02/62/2780262/html/wp-includes/pluggable.php on line 936
Warning: Cannot modify header information – headers already sent by (output started at /home/content/p3pnexwpnas09_data02/62/2780262/html/wp-content/plugins/buddypress/bp-members/bp-members-functions.php:2708) in /home/content/p3pnexwpnas09_data02/62/2780262/html/wp-includes/pluggable.php on line 937
Warning: Cannot modify header information – headers already sent by (output started at /home/content/p3pnexwpnas09_data02/62/2780262/html/wp-content/plugins/buddypress/bp-members/bp-members-functions.php:2708) in /home/content/p3pnexwpnas09_data02/62/2780262/html/wp-includes/pluggable.php on line 1207
BR
December 4, 2015 at 11:56 pm #53732@
AnonymousHi @anas-aljefry, Please try it after removing the above codes because those codes does not contains any rediction, it just to include the button link for register page. Please try the registration after removing this codes from functio.php
Regards
PallaviDecember 5, 2015 at 3:40 am #53738@anas-aljefryHello @pallavi,
I removed the above code since it wasn’t working for me before writing to you. The problem still exist.
BR
December 5, 2015 at 12:12 pm #53778@
AnonymousHi @anas-aljefry these warning are coming from buddypress plugin folder
Please update BuddyPress if it is not updated, else try to deactivate BP related plugins for a while to debug the issue. It might be plugin conflict.
RegardsDecember 5, 2015 at 2:01 pm #53783@anas-aljefryHello @vapvarun,
I’ve noticed after updating buddypress to 2.4.2 that the register and the login buttons in the navbar have disappeared. The logout button works fine.
December 6, 2015 at 5:08 pm #53877@anas-aljefryHello @pallavi,
Any update?
December 7, 2015 at 1:56 am #53884@
AnonymousHi @anas-aljefry, please send us your site’s login details at [email protected] along with the url of this thread so we can check the issues.
Regards
PallaviDecember 8, 2015 at 3:42 pm #54018@anas-aljefryHello @pallavi,
I was able to restore from a backup before login & register issue appeared. I was able to figure out the problem the buddypress register page and it works fine now.
The sensei register page stills show the same warning (after finishing the registration process) but if you could solve the redirection of the register button on the course page that would be a lot better.
BR
December 9, 2015 at 3:48 am #54044@
AnonymousHi @anas-aljefry, I got the site details and will check that and get back to you.
Regards
PallaviDecember 11, 2015 at 7:53 am #54237@anas-aljefryHello @pallavi,
Any update?
BR
- The question ‘Course Register Button’ is closed to new replies.