• Resolved fabbb

    (@fabbb)


    Hello,

    I use woocommerce with plugin members only because I want that visitors must be logged before viewing my products.

    So, if a visitor visit site.com or site.com/shop, he is redirected to site.com/my-account page wich include short code [woocommerce_my_account]

    He can login if he has a account, or create an account and password if he is a new visitor.

    Then I use the following code :

    add_filter('woocommerce_login_redirect', 'ras_login_redirect');
    function ras_login_redirect( $redirect_to ) {
         $redirect_to = 'http:/site.com/shop';
         return $redirect_to;
    }

    After login he is redirected to the products page.

    The problem is that if a new visitor create an account and password, he is redirected to my-account page.

    I would like that he is redirected to the products page also. http:/site.com/shop

    Does anybody have an idea ?

    Sorry for my english ..

    Thanks

    Fabbbb

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Thread Starter fabbb

    (@fabbb)

    /***** PAGE AFTER REGISTRATION *****/
    add_filter ( ‘woocommerce_registration_redirect’, ‘my_registration_redirect’);
    function my_registration_redirect( $redirect ) {
    $redirect = ‘https://www.site.com/after’;
    return $redirect;
    }

    /***** HOME AFTER LOGOUT *****/
    add_filter(‘logout_url’, ‘projectivemotion_logout_home’, 10, 2);
    function projectivemotion_logout_home($logouturl, $redir)
    {
    $redir = get_option(‘siteurl’);
    return $logouturl . ‘&redirect_to=’ . urlencode($redir);
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Redirect after create an account’ is closed to new replies.