Site logo

Archived topic

remove login form on my account page

10 replies · Started by Jusung on February 26, 2023

Viewing posts 1–11 of 11

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?

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

but not working..

.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..

/* 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..

Hi there,

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

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.

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.

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.

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....

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!!

This archived topic is closed to new replies.