I am trying to implement "to favourite" feature for my website.
User can visit whole website without login, but if they want to mark their favourite out of some results they need to login.
I'm clear with the login of add to favourite feature, now only problem is, as I said user don't need to login when they land on website but if they clicked on an "add to favourite" button it should check for login status (I know they are not logged in initially) then bootstrap modal should appear with social login (real problem).
So how I could present login page in modal if he is not logged in?
My code is:
<button class='btn btn-sm btn-info favourite_feature' value="<?php echo $id;?>">favourite</button>
$(document).ready(function()
{
$(".favourite_feature").click(function(){
var _this = $(this);
var postid = _this.val();
$.ajax({
type : 'POST',
url : '/add_favourite.php',
dataType : 'json',
data : '$postid='+ postid,
});
});
});