# Set rating metafield

> The set_rating metafield on set products and collections: its JSON shape, when Luxe writes it, and reading it from a custom theme.

Source: https://www.luxesets.com/docs/set-ratings

> **For developers and agencies.** Luxe already draws a set's rating in the Bundle set builder, the Collection set tray
> and Make it a set, with no code. Merchant guide: [Set ratings](https://www.luxesets.com/help/set-ratings). This page is for themes that want
> to show it elsewhere, such as on their own product cards.

## Where it lives

| Owner                                            | Metafield                                     | Type   | Access                                            |
| ------------------------------------------------ | --------------------------------------------- | ------ | ------------------------------------------------- |
| The set product of a Build-your-own or Fixed set | `set_rating` in Luxe's app namespace (`$app`) | `json` | Shopify admin: read only; storefront: public read |
| The collection of a Collection set               | `set_rating` in Luxe's app namespace (`$app`) | `json` | The same                                          |

Shopify admin lists both definitions as **Luxe set rating** (Settings > Custom data, Products and Collections). Merchants edit nothing there: Luxe is the writer.

## Shape

```json title="set_rating"
{
  "schemaVersion": 1,
  "v": 4.7,
  "n": 1203,
  "k": 3,
  "t": 4,
  "st": "c",
  "at": "2026-10-26"
}
```

| Key             | Type   | Meaning                                                                                                                         |
| --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------- |
| `schemaVersion` | number | `1`. A later version only adds keys                                                                                             |
| `v`             | number | The rating of the set's items on five stars, weighted by their review counts and **rounded down** to one decimal (4.726 is 4.7) |
| `n`             | number | The reviews of the counted items, in total                                                                                      |
| `k`             | number | How many of the counted items have a rating                                                                                     |
| `t`             | number | How many items were counted                                                                                                     |
| `st`            | string | The merchant's style: `c` (stars and count) or `rn` (stars, rating and count)                                                   |
| `at`            | string | The day it was computed, `YYYY-MM-DD`                                                                                           |

The ratings come from Shopify's standard product review fields (`reviews.rating`, `reviews.rating_count`) that review apps write, or from Okendo's own fields for a product without them. Luxe never writes those fields.

## When it exists

**A value present means "show it"; an absent value means "show nothing".** Luxe applies every rule before writing, so a theme applies none:

- It is written only while **Settings > Storefront > Set ratings** is on (off by default) and the set's own **Show this set's rating** is on.
- The set must reach the merchant's **Minimum reviews** in total, with at least half of its counted items rated.
- It is removed when any of these stops holding, and with the rest of the set's data when the set is archived, deleted or paused by Luxe, or moves to another product or collection.
- It is refreshed at each save of a live set, when its items change in Shopify, and nightly, so it is at most a day old.

Counted items: a Fixed set's components; a Build-your-own set's pickable items (or its default picks, if the merchant chose so); a Collection set's first 250 products in the collection's order. Only products active on the Online Store count.

## Reading it in a theme

Inside Luxe's own theme app extension the namespace is written `$app`. **Theme code outside that extension** uses the full namespace Shopify gives Luxe's app: `app--429457604609`. It is also shown on the **Luxe set rating** definition in Settings > Custom data.

```liquid title="Liquid"
{%- assign sr = product.metafields['app--429457604609'].set_rating.value -%}
{%- if sr and sr.v > 0 -%}
  <p class="set-rating">
    <span aria-hidden="true">★</span>
    {% if sr.st == 'rn' %}{{ sr.v }} · {% endif %}{{ sr.n }} reviews of the items in this set
  </p>
{%- endif -%}
```

On a collection page, read `collection.metafields['app--429457604609'].set_rating.value` the same way. Say what the number is: the rating of **the items in the set**, never the set's own reviews.

## No structured data

Luxe never adds `aggregateRating` or any JSON-LD for a set and never changes the theme's or the review app's Product markup: Google's review snippet rules do not allow the rating of a list of items to be marked up as one product's. A theme that reads `set_rating` should not add it to structured data either.

## Display only

No line property, no price and no Function input comes from it, and billing never reads it.
