Login and Logout - by JS - on WordPress WooCommerce support

This topic has 6 replies, 4 voices, and was last updated 3 years, 1 month ago ago by Rose Tyler

  • Avatar: JS
    JS
    Participant
    August 13, 2020 at 15:00

    1) When i login to my website, it goes to my account page, i know it is a default, but how can i redirect it to my homepage instead?

    2) When logout, i find that i need to confirm logout again before i can logout, how can i make it just a simple step, once logout then it is done?

    Please, contact administrator
    for this information.
    5 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 14, 2020 at 13:06

    Hello,

    1) Our theme does not have such options but you may try WooCommerce plugin to implement this redirect, read WooCommerce documentation https://docs.woocommerce.com/document/redirect-after-login-registration-logout/

    2) Try this plugin https://wordpress.org/plugins/disable-woocom-logout-confirmation/

    Regards

    Avatar: JS
    JS
    Participant
    August 15, 2020 at 11:07

    Hi, i managed to direct user who login via email to homepage. however, if the user login via facebook, it will still go to the my account page. Can you help me with it?

    function ts_redirect_login( $redirect ) {

    $redirect_page_id = url_to_postid( $redirect );
    $checkout_page_id = wc_get_page_id( ‘checkout’ );

    if( $redirect_page_id == $checkout_page_id ) {
    return $redirect;
    }

    return wc_get_page_permalink( ‘/’ );
    }

    add_filter( ‘woocommerce_login_redirect’, ‘ts_redirect_login’ );

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 17, 2020 at 16:06

    Hello,

    Check now, please. I have added the custom code to child theme functions.php.

    Regards

    Avatar: chihao.weng
    howard
    Participant
    February 3, 2021 at 14:31

    May I know what custom code you added to functions.php?

    I’d like to redirect user to checkout page if they use facebook login

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    February 4, 2021 at 09:56

    Hello,

    Olga Barlow is on vacation right now. Check the functions.php file by yourself, or ask this question one more time on Monday.
    I hope for your understanding.

    Regards

  • Viewing 6 results - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.