Liquid Customer Object Returning Null/Empty for Logged-In Users

Topic summary

A user reports that the Liquid customer object frequently returns null or empty even when users are logged in, sometimes updating only after a delay.

Key Questions Raised:

  • What conditions cause the customer object to return null for authenticated users?
  • Does guest checkout (without account creation) result in a null customer object?

Insights Provided:

  • Caching/Session Delays: The object may not populate immediately after login due to caching or session timing issues.
  • Page Context: Certain pages (cart, checkout) may not have the customer object available if cached or in guest mode.
  • Guest Checkout Behavior: Shopify does not create a customer account for guest orders, so the customer object remains null or incomplete in these cases.

Troubleshooting Suggestions:

  • Test with manual page refreshes or check subsequent pages
  • Use {{ customer | json }} for debugging across different pages
  • Review recent theme customizations or app installations that might interfere with sessions

New Development:
A third participant reports the customer object is consistently null after users upgraded to Shopify’s new customer account management system, suggesting this may be a broader compatibility issue. The discussion remains open with this unresolved concern.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Hi everyone,

I’m experiencing an issue with the Liquid Customer object. Even when a user is logged in, the customer object often returns as null or empty, and I’ve noticed that in some cases it only updates after a delay. I have a couple of questions regarding this behavior:

  • Under what conditions might the customer object return null even for logged-in users?
  • If a customer places an order as a guest (without creating an account), is a customer object created, or does it remain null?

Has anyone encountered this issue or can provide insights into why this might be happening? Any help or pointers on how to troubleshoot this would be greatly appreciated!

Thanks in advance.

Hello @davion ,

I’ve seen this happen before, and here are a few insights that might help:

  1. When Might the Customer Object Return Null?

    • Caching/Session Delay: Sometimes, especially right after login, there can be a slight delay before the Liquid customer object is fully populated.
    • Page Context: Depending on the theme or page you’re on (like the cart or checkout), the customer object may not be immediately available if the page is being cached or if it’s a guest session.
  2. Guest Checkout vs. Account Creation:

    • When a customer places an order as a guest (without creating an account), Shopify doesn’t create a customer account in the usual sense. In these cases, the customer object will generally be null or incomplete because the order is processed without associating it with a registered account.
  3. Troubleshooting Tips:

    • Force a Refresh: Check if the customer object appears after a manual refresh or on subsequent pages, which might indicate a caching delay.
    • Theme Debugging: Try outputting {{ customer | json }} on various pages to see if the data eventually loads.
    • Check for Custom Code: Sometimes customizations or apps might interfere with customer sessions, so review any recent changes in your theme or installed apps.

Hope these pointers help you pinpoint the issue! Let me know if you need any further insights.

Best,
Tracy from Kudosi Reviews

1 Like

Hi,

Since that my app users have upgraded their account management with the new system, it appears that this object is always null. Do you face the same problem?