Created
May 13, 2014 11:26
-
-
Save stefanbc/1e8301f23cc0d324b456 to your computer and use it in GitHub Desktop.
Login with Facebook using Login Radius in Prestashop
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
<!-- Requires dependencies https://github.com/carhartl/jquery-cookie --> | |
<script src="{$js_dir}jquery.cookie.js"></script> | |
{if $smarty.get.fb == 1 && $page_name == 'index'} | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
// console.log("BEFORE"); | |
var cookie = $.cookie("loggedinFB"); | |
// console.log("Cookie: " + cookie); | |
if (cookie != 'logged') { | |
// console.log("AFTER"); | |
$.cookie("loggedinFB", 'logged'); | |
window.location.href = 'https://%YOUR_LOGINRADIUS_URL%/requesthandlor.aspx?apikey=%YOUR_API_KEY%&provider=facebook&callback={$base_uri}?fb=1'; | |
} else { | |
window.location.href = 'https://apps.facebook.com/%YOUR_FACEBOOK_APP%'; | |
} | |
}); | |
</script> | |
{/if} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment