Normally, the home page will be refreshed when your user clicks the login link. It’s boring and ineffective for your users to login to your store. In fact, it’s unnecessary to redirect the user to the login page for validating his email address and password. An ajax login page is enough for such kind of user action. I have implemented an elegant plugin for it.
When your user click the login link in your bootstrap template, he could enter the email address and password in above popup page. The logo will be replaced by your store logo automatically. You user could also click the x button at right corner to close it.
Once he click the Sign in button, the data will be sent to your system to validate. At meantime, a processing box will be shown at the center of the user’s browser window to represent that the login request is processing by your server.
Then, if the user data is validated by your system, the page will be closed automatically. The login link will be replaced with logoff automatically. Now, the user is logged into your system automatically.
If you like this plugin, please integrate it into your store as follows:
Step 1. Download templates.zip from dropbox.
Step 2. Unzip it and then copy templates fold into your TomatoCart root directory. Just override it (this will not impact your template. Don’t worry about it).
Step 3. Open index.php under templates > bootstrap fold to find following code in it:
<script type="text/javascript"> jQuery.noConflict(); </script>
Add following code after it:
<script type="text/javascript" src="templates/<?php echo $osC_Template->getCode(); ?>/javascript/ajax.login.js"></script> <script type="text/javascript"> jQuery(document.body).ready(function() { jQuery('.main-nav a:contains("Login")').ajaxLogin({ 'label_email_address': '<?php echo $osC_Language->get('field_customer_email_address'); ?>', 'label_password': '<?php echo $osC_Language->get('field_customer_password'); ?>', 'logo': '<?php echo site_logo(); ?>', 'btnSign': '<?php echo $osC_Language->get('button_sign_in'); ?>', 'logOffLink': '<?php echo osc_link_object(osc_href_link(FILENAME_ACCOUNT, 'logoff', 'SSL'), $osC_Language->get('logoff')); ?>', 'forgetLink': '<?php echo osc_link_object(osc_href_link(FILENAME_ACCOUNT, 'password_forgotten', 'SSL'), $osC_Language->get('forget_password')); ?>', 'ajaxProcessing': '<?php echo $osC_Language->get('text_ajax_processing'); ?>' }); }); </script>
Step 4. Add two language definitions into general group under admin panel > Definitions > Languages > Edit Module.
- password_forgotten: Password Forgotten?
- ajaxProcessing: PROCESSING
Done. Enjoy it.
Looking for quality TomatoCart Hosting? Look no further than Arvixe Web Hosting!