How can I disable 'Create Account' on my B2B store's login page?

Solved

How can I disable 'Create Account' on my B2B store's login page?

leblancweb
Tourist
6 0 3

As a B2B Shopify store, customers need to be vetted by us prior to having an account therefore the Create Account on login page needs to be disabled. We don't want them creating an account on their own.

 

Is there a simple piece of code (or code change) which can achieve this? I'm using the Yuva theme.

 

Thank you,

David

Accepted Solution (1)

Prashant-Patel
Shopify Partner
8 1 4

This is an accepted solution.

 
If you want to hide the "Create Account" option on the login page of your Shopify store, you'll typically need to make some adjustments to your store's theme. Here's a general guide on how to achieve this:

Note: Making changes to your theme files may impact your store's functionality. It's advisable to make a backup before making any modifications. 
 
1. Remove the registration page
  1. Access Theme Code:
  2. From your Shopify admin, go to "Online Store" and then click on "Themes."
  3. Find the theme you're using and click on "Actions" > "Edit code."
  4. Locate the "customers/register.json" File In the "Templates" directory. https://prnt.sc/aoaF5Tkygs_z
  5. Then find the section named "main-register" or similar.
  6. Edit the "main-register" File:
  7. Open the "main-register" file in the code editor.
  8. Comment on the full section or delete all code.
  9. Now registration form is removed.
2. Redirect the registration page to the login page
  1. Locate the theme.liquid in the layout folder:
  2. Find the </head> and add this JavaScript Code before the </head> tag. https://prnt.sc/mH0-2sXj2WlX

 

<script>
// Check if the current page is the registration page
if (window.location.pathname === '/account/register') {
// Redirect to the login page after a delay (e.g., 0.5 seconds)
setTimeout(function() {
window.location.href = '/account/login';
}, 500); // 500 milliseconds = 0.5 seconds
}
</script>​

 

 
3. Update the login page design
  1. Locate the "customers/login.json" File In the "Templates" directory. https://prnt.sc/uEkjfT-WQ42_
  2. Then find the section named "main-login" or similar.
  3. Edit the "main-login" File:
  4. Find this class "login-container".
  5. Change class name like this https://prnt.sc/8Olc_V7MB7QG
  6. Now complete the all changes.
If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
Contact me on aradeshanaprashant12@gmail.com regarding any help | Figma to Shopify
Shopify Theme Developer | Skype : live:apd12121998

View solution in original post

Replies 7 (7)

Prashant-Patel
Shopify Partner
8 1 4

This is an accepted solution.

 
If you want to hide the "Create Account" option on the login page of your Shopify store, you'll typically need to make some adjustments to your store's theme. Here's a general guide on how to achieve this:

Note: Making changes to your theme files may impact your store's functionality. It's advisable to make a backup before making any modifications. 
 
1. Remove the registration page
  1. Access Theme Code:
  2. From your Shopify admin, go to "Online Store" and then click on "Themes."
  3. Find the theme you're using and click on "Actions" > "Edit code."
  4. Locate the "customers/register.json" File In the "Templates" directory. https://prnt.sc/aoaF5Tkygs_z
  5. Then find the section named "main-register" or similar.
  6. Edit the "main-register" File:
  7. Open the "main-register" file in the code editor.
  8. Comment on the full section or delete all code.
  9. Now registration form is removed.
2. Redirect the registration page to the login page
  1. Locate the theme.liquid in the layout folder:
  2. Find the </head> and add this JavaScript Code before the </head> tag. https://prnt.sc/mH0-2sXj2WlX

 

<script>
// Check if the current page is the registration page
if (window.location.pathname === '/account/register') {
// Redirect to the login page after a delay (e.g., 0.5 seconds)
setTimeout(function() {
window.location.href = '/account/login';
}, 500); // 500 milliseconds = 0.5 seconds
}
</script>​

 

 
3. Update the login page design
  1. Locate the "customers/login.json" File In the "Templates" directory. https://prnt.sc/uEkjfT-WQ42_
  2. Then find the section named "main-login" or similar.
  3. Edit the "main-login" File:
  4. Find this class "login-container".
  5. Change class name like this https://prnt.sc/8Olc_V7MB7QG
  6. Now complete the all changes.
If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
Contact me on aradeshanaprashant12@gmail.com regarding any help | Figma to Shopify
Shopify Theme Developer | Skype : live:apd12121998
PaulNewton
Shopify Partner
7721 678 1626

@Prashant-Patel that only applies to old customer account template pages for the online sales channel and consumer accounts. It doesn't apply to the new enforced NON-customizable account screens for new customer accounts.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


Prashant-Patel
Shopify Partner
8 1 4

@PaulNewton Sir,

 

@leblancweb Need to change in Yuva theme with some simple piece of code. So I think don’t need to change on online sales channel.

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
Contact me on aradeshanaprashant12@gmail.com regarding any help | Figma to Shopify
Shopify Theme Developer | Skype : live:apd12121998
leblancweb
Tourist
6 0 3

OK, thanks. Would you have the code or should I contact the Yuva theme developers?

 

Thanks,

David (@leblancweb)

Prashant-Patel
Shopify Partner
8 1 4

Hey @leblancweb 

I already shared all the steps please follow and apply it. If you’re not able to do that mail me the store login details my email address is aradeshanaprashant12@gmail.com

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
Contact me on aradeshanaprashant12@gmail.com regarding any help | Figma to Shopify
Shopify Theme Developer | Skype : live:apd12121998
leblancweb
Tourist
6 0 3

Thank you so very much. I applied these code changes and it worked beautifully for me. I greatly appreciate your quick and expert advice. 😀

 

David (@leblancweb)

Brett_Helium
Shopify Partner
301 58 134

Hey @leblancweb,

It sounds like you already found a solution for this but I wanted to present a potential alternative to removing your create account form entirely, in case you or someone else in a similar situation wants to try this.

With the Helium Customer Fields app, we offer the ability to create a custom registration form for your site with an option to require account approval. Using this type of form, users will still be able to submit a registration application for your site, but you will be able to verify and approve/deny them before their account is actually created.

You can check out our documentation here for more about how this works: https://help.heliumdev.com/en/articles/6311748-how-does-account-approval-work

Brett | Helium
- Customer Fields ✪✪✪✪✪ (360+ reviews)
- Meteor Mega Menu ✪✪✪✪✪ (290+ reviews)
- Strike Automatic Discounts NEW!