Test if a Lead is Logged in with "MBB.data.lacid"

A previous version of this function tested for the "MBB.loggedin" variable. If you use this old method then you MUST update as shown below.

Sometimes you may want to display specific content for website visitors who are not logged in to a My Buying Buddy account, and then to display alternate content for leads who are logged into their accounts.
For example, Offer a PDF download on a page that shows a registration form if the lead IS NOT logged in - or the download link if the lead IS logged in.

The following JavaScript snippet demonstrates how you can perform this test.
(The initial jQuery()document) statement ensures that this code will load after the MBB Plugin has loaded.)


jQuery(document).on("mbb-widgets-loaded", function() {
if ( MBB.data.lacid ) {
do this
} else {
do that
}
});

 

Admin