We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Liquid customer Condition Not Triggered When Logged in as Admin

Liquid customer Condition Not Triggered When Logged in as Admin

Lily43546546
Shopify Partner
2 0 0

 

 

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.

Replies 2 (2)

PaulNewton
Shopify Partner
8031 688 1649

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.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


Lily43546546
Shopify Partner
2 0 0

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.