Hi guys,
I’ve found a few out-of-date solutions for this based on ‘Users’ but not for Members. Basically I’m trying to find a way to set up a store that will primarily be wholesale for logged in members. Without recreating two versions of the store (and having one behind a login wall) I would like general users to still be able to navigate the wholesale store but replace product elements if they are not a logged in member.
I get as far as the below snippet… but it always throws the else even when logged in. Any suggestions would be greatly appreciated
I’ve created a quick and dirty mockup image of what I’m proposing below too where the price element would be swapped out for an alternative element
import { authentication, currentMember } from 'wix-members';
$w.onReady(function () {
currentMember.getMember()
.then((member) => {
if (member) {
console.log("Member: " + member._id + "Show me prices");
}
else {
console.log("Need to log in for prices");
}
})
});