Overview
Introducing the new Login With Facebook feature! This is a single sign on integration that store owners can now use. It allows their customers to quickly login using their Facebook account for quick and easy registration. Everybody wins!
NOTE: There are two ways to connect. A quick connection, and a custom connection using your own Facebook app account.
How it Works
When a customer clicks the Facebook Button it will send them to a Facebook Login page. If they are already logged in, it will refresh and log them in through the AmeriCommerce online store. It will send the customer back to the AmeriCommerce online store, to the page they were at initially. So if the customer signs in at checkout through Facebook, they will then be redirected back to the checkout after signing up. They will also have an account created in the back end of the customer records, and automatically be logged in. This customer account is like any others, and all functionality is still available as if they were to register the usual way by typing in all their information. What's good too - When they return to the store if they select "Login with Facebook" they will be signed in with their Facebook account automatically.
Using the "Login with Facebook" feature will also pre-fill the customers name and email at checkout, which is a huge benefit for mobile device users.
The Setup
This is now included in all new themes from here on out. However, if you have an older theme you will need this to be added manually if you wish to have this functionality. See the section at the end of this article for code snippets, if needed
To get started, navigate to Tools > Apps & AddOns > Facebook Sign-In.
All you have to do is toggle the Integration Active for the quick and easy connection. This defaults to using the 'Social Login by AmeriCommerce' Facebook application.
Use your own Facebook App
NOTE: THE SECTION BELOW IS UNDER REVIEW TO CONFIRM PROPER CONFIGURATIONS. PLEASE USE THE SIMPLE METHOD ABOVE IF YOU EXPERIENCE ANY ERRORS USING YOUR OWN APP.
You can optionally use your own Facebook App. More information on creating an app can be found here: https://developers.facebook.com/docs/development/create-an-app/
After creating the app, you can get your App ID and App Secret by going to Settings > Basic in the left column. While on this page, set the app domain to americommerce.com - Then click "Show" next to the app secret, and copy them into your storefront settings for Facebook Sign-In.
Next, go to Settings > Advanced. Go to the "Share redirect allow list" section and either enable "Allow Cross Domain Share Redirects" or add https://public.americommerce.com/facebook/login to the "Share Redirect Domain Allow List"
Note: If you are adding any additional Facebook integration info above for an app you have, it will work with the temporary domain. So when you're in the works of this on the Facebook end you'll want to set the app domain to americommerce.com . But keep the subdomain in the site and mobile site urls. Otherwise, you will get this error:
Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
To prevent this from occurring, in the Facebook dev area for the app, you will also need to do the following:
- Navigate to the Settings tab on the left
- Select the Advanced tab at the top.
- Locate the setting "Client OAuth Login"
- Enable it.
- Find this setting: "Valid OAuth redirect URIs".
- Add https://public.americommerce.com/facebook/login to this field.
Note: Facebook login will not work if your Facebook application is in developer mode. Be sure to switch to live mode by going to the App Review Page:
Code for Older Themes
To manually add the Login With Facebook feature to the theme:
##FACEBOOKLOGIN## - This will need to go in the Customer Login Page
located under Themes > Edit > Pages > Customer Login > HTML Editor.
Note: ##FACEBOOKLOGIN## - can be used to place a Facebook login button almost anywhere instead of just on login pages.
The Customer My Account Page also needs to include the following:
*
*
If this is a newer theme, this CSS is already present. Otherwise, it will need to be added manually.
Find the following:
.form-signin input { position: relative; font-size: 16px; height: auto; padding: 10px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; width: 100%; }
Change it to:
.form-signin input, .form-signin button { position: relative; font-size: 16px; height: auto; padding: 10px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; width: 100%; }
Extra optional additions for further customization:
.FacebookButton { background-color: #4c66a4; color: #fff; }
.FacebookButton:hover { background-color: #364c7c; color: #fff; }
.FacebookButton .icon-facebook { font-size: 1.2em; }