Site logo

[Resolved] remove login form on my account page

Home Forums Support [Resolved] remove login form on my account page

Home Forums Support remove login form on my account page

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2548027
    Jusung

    Hello. I am trying to remove login form when you click my account page.
    So, people can see only register form there.

    .page-id-9 .woocommerce .u-column1 {
        display: none;
    }
    .page-id-9 .woocommerce .u-column2 {
        margin: auto;
        float: none !important;
    }

    This code is used to remove login form and it works well.

    However, this code also removes the “edit billing address” section.
    I only wanna remove login form.

    Is there a way to remove only login form?

    #2548049
    Jusung

    I tried to make hook element for this page.
    So, user-loged out.
    and added the code.

    but not working..

    #2548056
    Jusung
    .page-id-9 #customer_login .woocommerce .u-column1 {
        display: none;
    }
    .page-id-9 #customer_login .woocommerce .u-column2 {
        margin: auto;
        float: none !important;
    }

    This is my another trying, but not work..
    It has to be a certain page since the same form is being used on other page.
    And I try to add the ID cuz (.woocommerce .u-column2) is being used for edit billing address. So, I can’t solely use this..

    #2548067
    Jusung
    /* Remove Login on my account*/
    .page-id-9 #customer_login.woocommerce.u-column1 {
        display: none;
    }
    .page-id-9 #customer_login.woocommerce.u-column2 {
        margin: auto;
        float: none !important;
    }

    I don’t know what I am missing.. This is another trying, but doesn”t work..

    #2548469
    David
    Staff
    Customer Support

    Hi there,

    can i have a login so i can see the Edit Billing address issue ?

    #2548534
    Jusung

    I just added the user.

    My login page and register page is made using my account and only alloed to reach when logged out.

    So, on login, I have to remove register form and on register, I have to remove login form.

    But, when I remove the form, it removes the edit billing address part too.

    #2548893
    David
    Staff
    Customer Support

    Have you seen this method of separating login and account forms ?

    https://www.businessbloomer.com/woocommerce-separate-login-registration/

    #2549445
    Jusung

    The login and register column is under #customer_login
    The addresses feiled is under .woocommerce-Addresses

    Is there a way to utilize those?
    .page-id-9 #customer_login .u-column1 {
    display: none;
    }
    .page-id-9 #customer_login .u-column2 {
    margin: auto;
    float: none !important;
    }

    Like this for example. that code doesn’t work.

    #2549456
    Jusung

    I just tested the code above and this code is actually working..

    .page-id-9 #customer_login .u-column1 {
    display: none;
    }
    .page-id-9 #customer_login .u-column2 {
    margin: auto;
    float: none !important;
    }

    The only problem is that
    people can reach the page of login page even though there are logged in.
    So, I added this code to redirect to other page when logged-in user visit the login page.

    
    function my_custom_redirect() {
      if ( is_user_logged_in() && is_page( '362' ) ) {
        wp_redirect( 'https://abc.com/' );
        exit;
      }
    }
    add_filter( 'template_redirect', 'my_custom_redirect' );
    

    On my End, everything works well.
    Could you check if those codes are gonna be ok to use?
    I am not a developer so don’t know well about coding.

    #2549881
    David
    Staff
    Customer Support

    Those codes look fine.

    But as you have realised, redeveloping Woocommerce is not easy, and every change you make can have repercussions.
    And in making these changes, you now have the responsibility of maintaining those changes.
    If Woocommerce updates its code it could mean something you have changed will no longer work.

    Unless you have a Woocommerce developer to hand then i would strongly advise against changing these kinds of things. The standard woocommerce pages may not look pretty, but they work as intended….

    #2550082
    Jusung

    You are completely right..

    So far, I am understanding all the codes I changed.
    I will try to make as less change as possible.

    Thank you for the advice!!

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.