Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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
Solved! Go to the solution
This is an accepted solution.
<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>
This is an accepted solution.
<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>
@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
@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.
OK, thanks. Would you have the code or should I contact the Yuva theme developers?
Thanks,
David (@leblancweb)
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
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)
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
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025