This topic has 27 replies, 3 voices, and was last updated 11 years by Abe.

  • Author
  • #35412
     MTG
    Participant

    Hi,

    I would like that customers who do not have access to a directory to be redirected to the registration page and if they are registered but have not taken any subscription fee be returned to the page of membership levels for subscribe.

    How can i do this please ?

    Thank’s a lot.

    Bye

    #35506
     Laura
    Moderator

    Hello, you can set up who can access to each page in the page editor “Required Membership” Then check what level the user need to be to access to this page, any user without a subscription or not members will see a link to memberships levels page 🙂
    Hope it helps.

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

    Hi Laura, thank’s.

    The problem is that The problem is that I can not redirect users not registered on the registration page, they are automatically redirected to the memberships levels page.

    However, I would like that customers who are not registered to be redirected to the registration page, and then either redirected to the memberships levels page. I don’t know how to configure it.

    thank you

    #35760
     Laura
    Moderator

    Hello, users will be auto redirected to registration page of buddypress, but be sure you have Register page selected in Tools > Buddypress > Registration Page
    You can also give me access to your admin panel so i can check it out 🙂

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

    Hi,

    I have Registration page selected.

    You can connect to the admin panel there : http://www.rencontres-vrp.fr/connectvrp

    Login : vrp_mtg
    Password : PDT31670

    Before to connect to the admin panel, You’ll see, by going to this page: http://www.rencontres-vrp.fr/activite/ that you can not get to the registration page but on the memberships levels page.

    #35782
     Laura
    Moderator

    Hello, when an user registers, goes to this page, this is registration page (see attachments) So it is working fine, am i lost or i didnt understand your question? 🙂

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

    Hi Laura,

    I think I had trouble expressing myself (sorry for my english), in fact, I would like that a non-registered customer arrives on the registration page when trying to access to restricted access pages and when he’s registered he accesses the memberships levels page when he tries to return to the restricted access pages.

    There he goes directly to the memberships levels, as on this link: http://www.rencontres-vrp.fr/activite/ while I wish he goes to the registration page, see attached diagram.

    I hope to be clear 🙂

    Bye

    #35899
     Laura
    Moderator

    Hello, try to use this in your child theme functions.php

    COPY CODE
    
    add_action( 'template_redirect', function() {
    
      if ( is_user_logged_in() || ! is_page() ) return;
    
      $restricted = array( 250, 253 ); // all your restricted pages id
    
      if ( in_array( get_queried_object_id(), $restricted ) ) {
        wp_redirect( site_url( '/register' ) ); 
        exit();
      }
    
    });
    

    Change 250,253 to your restricted page ids, you can add as much as you want, to get the id of a page go to edit that page and check your browser link. Also change /register for your registration page.
    Users that are not subscribers will see a message ad a link to memberships levels if the page minimun level required is set, you can set in in edit page 🙂 This comes with pmpro so just restrict access with that.

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

    Hi Laura, sorry but it doesn’t work, i’m still going to the memberships page levels if i’m not registered and not the register page 🙁

    #35977
     Laura
    Moderator

    Hello, give me your ftp access so i can do it for you 🙂

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

    Can you give me your ip address to allow it for the FTP. And can you tell me which files you will have modified.

    Thank’s.

    #36038
     Laura
    Moderator

    Here 🙂

    COPY CODE
    
    62.43.40.198
    Will edit funtions.php if needed
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #36056
     MTG
    Participant

    Hi Laura, your IP is allowed. The access :

    Host : 212.83.150.120
    FTP user: vrp
    FTP passwd: Vte3!gRr1taP

    Let me know when you have done.

    Thank’s

    Bye

    #36205
     MTG
    Participant

    Hi Laura, did you find the solution?

    Thank’s

    #36263
     Laura
    Moderator

    Hello, there is some kind of conflict with your plugins, one or some of them is blocking stuff from working, you should deactivate all an test it, one of them is also blocking sweetdate menu from saving changes.

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

    I will try, you used this code or You made changes above?

    add_action( ‘template_redirect’, function() {

    if ( is_user_logged_in() || ! is_page() ) return;

    $restricted = array( 250, 253 ); // all your restricted pages id

    if ( in_array( get_queried_object_id(), $restricted ) ) {
    wp_redirect( site_url( ‘/register’ ) );
    exit();
    }

    Thank’s

    });

    #36270
     Laura
    Moderator

    Hello, yes that code should work, chaning /register for your page but first is resolve the conflicts.

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

    I tried te desactivate all plugins but it doesn’t work, the plugins still activated are :

    BBpress
    BuddyPress
    Paid Memberships Pro
    Revolution Slider
    WooCommerce

    How can I do ?

    #36460
     MTG
    Participant

    Hi Laura, I tried what you told me to do with a new install of the theme, but it doesn’t work, see the file attached.

    Is there any solution to resolve my problem ?

    Thank’s.

    #36464
     Abe
    Keymaster

    Hi,

    COPY CODE
    
    // redirect to registration page or membership levels page
    add_action('template_redirect', 'my_custom_redirect');
    
    function my_custom_redirect() {
    
        $restricted = array( 334 ); // all your restricted pages id
        $levels_to_check = array(1, 2, 3);
    
        if ( in_array( get_queried_object_id(), $restricted )) {
    
            if (is_user_logged_in()) {
                if (!pmpro_hasMembershipLevel($levels_to_check)) {
                   wp_redirect(pmpro_url("levels"));
                    exit;
                }
            } else {
                wp_redirect(bp_get_signup_page());
                exit;
            }
        }
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #36466
     MTG
    Participant

    Hi Abe, it doesn’t work and you broke my website !!!! The custom css in the admin panel has disappeared !!!!

    #36468
     Abe
    Keymaster

    just updated it. the code goes in kleo-child/functions.php

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

    I don’t have any kleo-child file

    #36470
     Abe
    Keymaster

    you should install it from the package downloaded

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

    Sorry but in the sweetdate package downloaded, i don’t have kleo-child

    #36479
     Abe
    Keymaster

    sorry I meant sweetdate child

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

    Hi Abe,

    It doesn’t work. When I put this code in functions.php, in sweetdate child, I have a white screen in the site.

    #36825
     Abe
    Keymaster

    Well you need basic php knowledge. Add it before the ending ?> tag. Try hiring a programmer to help with customizations

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

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?