BuddyBoss Home – Web Support Forums Solutions Social Learner Course Register Button

Viewing 15 posts - 1 through 15 (of 21 total)
  • Question

    #52359
    @anas-aljefry

    Hello,

    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

    #52377

    Anonymous
    @

    Hi @anas-aljefry, This code is for Sensei not for Learndash. Please let me know you issue so we can assist you properly.

    Best
    Pallavi

    #52386
    @anas-aljefry

    Hello @pallavi,

    Yes, I’m aware of that. I’m using the sensei plugin.

    BR

    #52614
    @anas-aljefry

    Hello @pallavi,

    Any update?

    #52688

    Anonymous
    @

    Hello @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
    Pallavi

    #53726
    @anas-aljefry

    Hello @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

    #53732

    Anonymous
    @

    Hi @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
    Pallavi

    #53738
    @anas-aljefry

    Hello @pallavi,

    I removed the above code since it wasn’t working for me before writing to you. The problem still exist.

    BR

    #53778

    Anonymous
    @

    Hi @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.
    Regards

    #53783
    @anas-aljefry

    Hello @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.

    #53877
    @anas-aljefry

    Hello @pallavi,

    Any update?

    #53884

    Anonymous
    @

    Hi @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
    Pallavi

    #54018
    @anas-aljefry

    Hello @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

    #54044

    Anonymous
    @

    Hi @anas-aljefry, I got the site details and will check that and get back to you.

    Regards
    Pallavi

    #54237
    @anas-aljefry

    Hello @pallavi,

    Any update?

    BR

Viewing 15 posts - 1 through 15 (of 21 total)
  • The question ‘Course Register Button’ is closed to new replies.