Hello,
I am trying to use Snipcart.store.getState().customer
to pull the current customer’s email address. But this always shows that there is no customer logged in. It’s not seeing the current customer and I’m not sure why.
<script>
document.addEventListener('snipcart.ready', () => {
const customer = Snipcart.store.getState().customer;
console.log(customer.email);
});
</script>