Disabling chat feature (Crisp) from other membership type (eg. Free vs Premium)

Is it possible to have Crisp disabled from another membership type? You have a piece of code laying around @belltyler? :slight_smile:

1 Like

Hi @Anttoni_Aniebonam,

Yes this is actually possible! I’ll put some code together and will post it here later.

Just change data-memebrship-id to the ID of the membership you want the chat to hide for.

<script>
MemberStack.onReady.then(function(member) {

   var membership = member.membership

   if (membership.id === "data-membership-id") {
    $crisp.push(['do', 'chat:hide'])
   }
   
})
</script>
1 Like

Hi Tyler, I’m trying to do the same thing but with Intercom. Is there something I can add to the code below to make it possible to hide the messenger from multiple membership types?

<script>
MemberStack.onReady.then(function(member) {
    
    window.intercomSettings = {
        app_id: "---",
        name: member["first-name"],
        email: member["email"],
        
    };
    
})

Hey Ryan, yes that should also be possible. I would try this…

<script>
MemberStack.onReady.then(function (member) {

    var membership = member.membership

    var membership_id = membership.id

    var valid_memberships = [
        "membership1",
        "membership2"
    ]

    var launcher = false

    if (valid_memberships.includes(membership_id)) {
        launcher = true
    }

    window.intercomSettings = {
        app_id: "---",
        name: member["first-name"],
        email: member["email"],
        hide_default_launcher: launcher,
    };

})

Add the membership ids you want intercom to show for in the valid_memberships list.

I tried this and it didn’t work. Is the membership ID the same as the data attribute value for the membership? Also, might it be possible to show/hide the launcher based on the value of a given data field?