Order status page script to tell if a customer has an account

Order status page script to tell if a customer has an account

mrsilver123
Shopify Partner
17 0 1


I added th following script to the order status page.

<script>
{% if customer.has_account %}

console.log("User account exists")

{% else %}

console.log("User account does not exist")
{% endif %}

It seems to work when viewing orders that are a day old. But if I make an order, and then initially see the order status page, {% if customer.has_account %} is not returning true.

Any ideas why or a better method of checking if the customer has an account from the order status page.

Replies 0 (0)