> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lantern.is/llms.txt
> Use this file to discover all available pages before exploring further.

# wishlist

> Access the customer's wishlist items as an array of product variant references.

## Syntax

<Tabs>
  <Tab title="Liquid">
    ```liquid theme={null}
    customer.metafields.lantern.wishlist
    ```
  </Tab>
</Tabs>

## Description

The `wishlist` metafield contains an array of product variant GIDs (Global IDs) that the customer has added to their wishlist. This is automatically updated when customers add or remove items from their wishlist through the loyalty program.

<Info>
  The wishlist metafield contains a JSON array of Shopify product variant GIDs that must be parsed using Liquid's `parse_json` filter before accessing.
</Info>

## Properties

**Type:** `JSON Array`
**Namespace:** `lantern`

## Return Values

| Scenario                    | Value                 | Type       |
| --------------------------- | --------------------- | ---------- |
| Customer has wishlist items | Array of variant GIDs | JSON Array |
| Customer has empty wishlist | `[]` (empty array)    | JSON Array |
| Logged out                  | `null`                | null       |

## Array Structure

The wishlist is an array of Shopify product variant Global IDs:

* `[index]` (string): Shopify product variant GID (for example `gid://shopify/ProductVariant/123456789`)

## Examples

### Basic Wishlist Display

```liquid theme={null}
{% assign wishlist_data = customer.metafields.lantern.wishlist %}
{% if wishlist_data %}
  {% assign wishlist_gids = wishlist_data | parse_json %}
  
  {% if wishlist_gids.size > 0 %}
    <div class="wishlist-count">
      {{ wishlist_gids.size }} item{% unless wishlist_gids.size == 1 %}s{% endunless %} in wishlist
    </div>
  {% endif %}
{% endif %}
```

### Check if Product is in Wishlist

```liquid theme={null}
{% assign wishlist_data = customer.metafields.lantern.wishlist %}
{% if wishlist_data %}
  {% assign wishlist_gids = wishlist_data | parse_json %}
  {% assign current_variant_gid = 'gid://shopify/ProductVariant/' | append: product.selected_or_first_available_variant.id %}
  
  {% if wishlist_gids contains current_variant_gid %}
    <button class="wishlist-btn active">♥ Remove from Wishlist</button>
  {% else %}
    <button class="wishlist-btn">♡ Add to Wishlist</button>
  {% endif %}
{% endif %}
```
