BuddyDev

Search

[Resolved] Buddypress profile completion

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #48520

    Hello,

    Please I cant seem to get this code to work for woocommerce product page

     // Do not skip redirect on account verification product page.
    function buddydev_dont_skip_redirect_on_product_verification_page( $skip ) {
        global $post;
        if ( is_product() && $post->ID == wc_get_page_id( 'account-verification' ) ) {
            if( is_user_logged_in() ){
                $skip = false;
            }
        }
        return $skip;
    }
    add_filter( 'bp_force_profile_completion_skip_check', 'buddydev_dont_skip_redirect_on_product_verification_page', 20 ); 
  • Keymaster
    (BuddyDev Team)
    Posts: 24231
    Brajesh Singh on #48521

    Hi Tosin,
    Please provide more details.
    What is your goal? What is the context?

    Thank you
    Brajesh

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #48522

    I have the code not redirect users on non buddypess pages

     
    // Do not redirect users on non bp pages.
    function buddydev_skip_redirect_on_non_bp_pages( $skip ) {
        if ( ! is_buddypress() ) {
            $skip = true;
        }
        return $skip;
    }
    add_filter( 'bp_force_profile_completion_skip_check', 'buddydev_skip_redirect_on_non_bp_pages' );
    

    but now I don’t want to skip the redirect on a specific woocommerce product page using the code provided earlier, but the code does not work. Users without profile photo can still access the (account-verification) product

  • Keymaster
    (BuddyDev Team)
    Posts: 24231
    Brajesh Singh on #48523

    Hi Tosin,
    Thank you for the reply.

    1. I don’t see anywhere that our team has supplied the code in your original post. Can you please link me?

    2. Let me ascertain it once more. You want to skip redirect on a single Woo product, rest of the site should still redirect?

    Thank you
    Brajesh

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #48569

    Hi Brajesh

    I got this working with the code

     function buddydev_dont_skip_redirect_on_account_verification_page( $skip ) {
        global $post;
        if ( $post->post_name == 'account-verification' ) {
            if( is_user_logged_in() ){
                $skip = false;
            }
        }
        return $skip;
    }
    add_filter( 'bp_force_profile_completion_skip_check', 'buddydev_dont_skip_redirect_on_account_verification_page', 20 ); 

    Strange but I should have not used this code

    if ( is_product() && $post->ID == wc_get_page_id( ‘account-verification’ ) ) {

    This is noe resolve

  • Keymaster
    (BuddyDev Team)
    Posts: 24231
    Brajesh Singh on #48582

    Hi Tosin,

    I am glad you have got it resolved.

    I will appreciate if you can provide context in future questions to help us understand better.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved