Last active
May 26, 2022 14:46
-
-
Save SmashBrando/99c88bc6ed9b93969dd9 to your computer and use it in GitHub Desktop.
BigCommerce Login Redirect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a script for BigCommerce Store Owners. | |
If you are trying to force user to login before viewing your store, use this handy script. | |
Here is what it does: | |
1. If the user is not logged in, the page will redirect to the login page. | |
2. If the user is on the login page, they stay until they login. | |
3. Once they are logged in, they can freely browse. | |
The script does not direct the user to a specific page after login. | |
If you need help or would like a modification, you can drop me a line here - http://brandonjkidd.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- place this snipet in HTMLhead.html, replace yourdomain with the url of your login page --> | |
<script> | |
$(document).ready(function(){ | |
if( | |
($('#LoginOrLogoutText > div > a:contains("Sign in")').length > 0) && (window.location.href.indexOf("login") === -1) | |
){ | |
window.location.assign("//www.yourdomain.com/login.php"); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
seems like doesn't work.