Liquid customer Condition Not Triggered When Logged in as Admin

In Liquid:

{% if customer %}

When using an admin account to log in, it often fails to be recognized — this condition doesn’t execute, meaning it is treated as if no user is logged in.

Hi @Lily43546546 Admin != customer.

They are different words for a reason.

Admin accounts accessing the shopify admin are NOT customers on purpose.

Either

  • just make the test customer account in the customers admin.
  • use the frontend to register a customer account like any customer would; if customer accounts are enabled.
  • Or make a test purchase checkout using a test gateway creating a customer during that ; if customer accounts are enabled.
  • Or make a real purchase through checkout creating a customer during that ; if customer accounts are enabled.

We are a newly registered account, not an admin account. Initially, the system could recognize the customer upon login, but after a while, Liquid fails to retrieve the customer information even though the login status remains active, and we can still access the shopping cart directly.