Skip to main content
Layers can build product families automatically from Shopify metafields. Configure which metafields to watch, and Layers groups eligible products into families during catalog sync. Use this when an existing Shopify metafield already encodes “these products belong together”. Two metafield types are supported: A collection reference works as a shared style key. Layers groups the products whose metafield points at the same collection. It does not add every product inside that collection to the family.

How it works

Product list metafields

  1. You configure one or more metafield namespace/key pairs in Settings → Product Families.
  2. During a bulk catalog import or a product webhook sync, Layers reads the configured metafields on each product.
  3. Layers starts with the product that owns the metafield and the products it references.
  4. Products already assigned to a manual or attribute-driven family, or to a metafield family from a different key, stay in their existing family.
  5. Layers creates or updates the family named Auto: {namespace}.{key} only when at least two eligible products remain.
  6. Layers sorts eligible product IDs before building the family, so the same set of products always maps to the same family regardless of metafield ordering.

Collection reference metafields

  1. You configure the metafield in Settings → Product Families, the same way as a product list metafield.
  2. During catalog sync, Layers reads the referenced collection on each product.
  3. Products that reference the same collection join one family named Auto: {namespace}.{key} (Collection {collection ID}). Products that reference a different collection join a different family.
  4. The family becomes active once at least two products belong to it. A family with a single product stays in draft.
  5. Products already assigned to a manual or attribute-driven family, or to a metafield family from a different key, stay in their existing family.
When you change a product’s collection reference in Shopify, Layers moves only that product to the family for the new collection. When you clear the value, Layers removes the product from its family. A family left with one product returns to draft, and an empty family is deleted.

Configure family metafields

  1. Go to Settings → Product Families.
  2. In the Family Metafields card, click Add Metafield.
  3. Select the metafield from the combobox. Only list.product_reference and collection_reference metafields produce families; other types are ignored.
  4. Click Save.
  5. Layers backfills families from existing metafield values as soon as you save. You don’t need to trigger a catalog resync.
You can configure multiple metafields. Each is handled as a separate source, and can create families from products that are not already assigned to a higher-priority family.

Examples

Product list example

Given a custom.related_styles metafield on three products that all reference each other: Assuming none of these products already belongs to another family source, Layers creates a single family Auto: custom.related_styles containing products 1001, 1002, and 1003. The owning product is included, and the sorted product IDs collapse to one family regardless of which product is being processed.

Collection reference example

Given a custom.style metafield that references a collection on four products: Layers creates an active family for collection 501 containing products 1001, 1002, and 1003. Product 1004 is the only product that references collection 502, so its family stays in draft until another product references the same collection. Other products that belong to collection 501 in Shopify but don’t reference it in custom.style are not added.

Conflict resolution

  • If a product is moved into a new metafield-driven family for the same namespace.key, Layers removes it from any older metafield family for that same key. A family left with fewer than two products is deleted.
  • A product already assigned to a manual or attribute-driven family stays in that family.
  • If a product is already assigned to a metafield family from a different key, the first key to claim it keeps the product. Other keys can still create families from their remaining eligible products when at least two products remain.

Removing metafields from the config

When you remove a metafield from the Family Metafields config (or clear it entirely), Layers cleans up the families it previously produced:
  • Memberships in metafield-sourced families for the removed namespace.key are deleted.
  • Families left with no members are deleted.
  • Families left with only one member are demoted to draft.
  • Manual and attribute-sourced families are not touched.
Cleanup runs as part of the same backfill job that reconciles attribute-driven families. Removing a metafield entry reclaims its families immediately, without waiting for the next product sync.

Limitations

  • Only Shopify metafields of type list.product_reference or collection_reference produce families.
  • A family must contain at least two unique products to be created.
  • Metafield-driven families are read-only in the Product Families dashboard. To change their membership, edit the underlying metafield values on your products in Shopify.

See also