Thursday, January 19, 2017

Magento 1.9 Ajax Login with Social Connectors

We are using Magento 1.9 right now for one the project as Magento 2.0 has certain performance issue and some of the extensions are not yet available for Magento 2.0. In this project we have a requirement to add Ajax Login with Social connector options which includes, login with Facebook and Login with Google. Problem we faced is, there is no free extension available in market which allows both ajax login and give you social connector options. So what I did is I installed two different extensions for Ajax Login and Social Connectors and then merged code from social connector plugin to Ajax Login plugin.

In this blog I am going to explain how you can do this.

First of you have to install following two plugins in Magento.

GoMage Social Connector
Ajax Login

With the first login you will get social login options in admin where you can configure your social networks like Facebook and Google and add necessary information like App id and redirect URL etc.

Once it's configured in admin, you will get Social Connectors option in login page like this.



But we need this options in Ajax Login Popup.




So to do this we will copy code for GoMage Extension to this. To do this go to.

app/design/frontend/base/default/template/digitalpianism/ajaxlogin

And open index.phtml file.

Add following code before buttons code.

<!-- Social Login -->
<a href="#" onclick="gomageSocialFBLogin();return false;" title="<?php echo $this->getText('facebook') ?>">
Login with Facebook
</a>

<a href="<?php echo $this->getUrl('gomage_social/google/login', array('_secure' => true, 'gs_url' => Mage::helper('core')->urlEncode(Mage::helper('core/url')->getCurrentUrl())));  ?>" title="<?php echo $this->getText('google') ?>">
Login with Google
</a>

That's it and now you will have social connector options in Ajax login.




I have just added basic designs, you can change it as per your requirements.

No comments:

Post a Comment