This topic has 8 replies, 3 voices, and was last updated 6 years by Radu.

  • Author
  • #205066
     tulipwork
    Participant

    Hi,

    Currently, the user who clicks on “register” BuddyPress/WordPress native link is redirect to the classical BuddyPress registration form. But if the user clicks on a page that is restricted by the PMPro plugin, he’s redirect to the PMPro register form.

    The 1st problem is that there are two different register forms. The second pb is that the PMPro register form do not provide the BuddyPress additionnal fields, so the user creates a minimalist profile without any information about him.

    The solution is to insert the BuddPress register form inside the PMPro register form, mayby with different steps : Choose membership level > BuddyPress native form > Additionnal BuddyPress fields > Payment.

    How to do it?

    Thank you very much,

     

    #205142
     Laura
    Moderator

    Hello, buddypress fields cant be at pmpro, you could use buddypress members only plugin to redirect users to buddypress register page when accessing those pages

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #205144
     tulipwork
    Participant

    Hi, in fact you’re right, if I’m using Buddypress Members Only, it’s redirecting logged out users to BuddyPress registration page. This fix my problem. However, it’s redirecting french users to the English registration form. How to have a WPML friendly redirect?
    Thanks.

    #205203
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #205215
     tulipwork
    Participant

    Hi, thank you very much, I’m waiting.
    It’s the last problem to fix before launching my website, except that, everything is working.

    #205314
     tulipwork
    Participant

    Anything new about this issue? Thanks in advance.

    #205324
     Radu
    Moderator

    Hi,

    I see the redirection it’s handled by that plugin “Buddypress Members Only” and this redirect english to french version.

    A workaround my be to de-activate that plugin and to use two snippets that handles the redirection for every language from example, so that plugin should be compat with wpml.

    Homepage french : domain.com/fr/ -> will redirect guests to domain.com/fr/register
    Homepage english : domain.com/en/ -> will redirect guests to domain.com/en/register

    This snippet should handle both of them cuz it’s using relative urls

    COPY CODE
    
    function sqr_prevent_search_guest_user() {
        if ( class_exists( 'BuddyPress' ) ) {
            if (!is_user_logged_in() && bp_is_directory() && is_front_page()) {
                wp_redirect(home_url() . '/register/');
                exit;
            }
        }
    }
    add_action('template_redirect', 'sqr_prevent_search_guest_user');
    
    

    The snippet may be added to wp-content/themes/sweetdate-child/functions.php

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #205356
     tulipwork
    Participant

    It’s absolutely perfect !

    If someone needs this snippet, I changed yours to that in order to be more efficient:

    COPY CODE
    function sqr_prevent_search_guest_user() {
        if ( class_exists( 'BuddyPress' ) ) {
            if (!is_user_logged_in() && (bp_is_directory() || bp_is_user())) {
                wp_redirect(home_url() . '/register/');
                exit;
            }
        }
    }
    add_action('template_redirect', 'sqr_prevent_search_guest_user');
    #205546
     Radu
    Moderator

    Great
    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?