Automatic Size Chart Display for Products

Auto-selecting appropriate size charts based on category, item type, and gender

Size ChartShopifyMetafieldsE-commerceAuto Selection
2 min read

About This Project

When selling apparel and sports equipment on e-commerce sites, size charts are essential information for purchase decisions. However, the applicable size chart varies depending on category, item type, and gender.

In this project, we built a system that automatically displays "the right size chart for this product" on product pages.

The Challenge

The apparel e-commerce site faced these challenges:

  • With many products, manually setting appropriate size charts for each was impractical
  • Many size charts exist for combinations of category × item type × gender
  • Special products (racing suits, etc.) require dedicated size charts
  • Administrators need to flexibly change mappings during operation

The Solution

We implemented a system that automatically selects appropriate size charts based on mapping tables, utilizing product metafields (e.g., category, gender, product type).

Learn More

We explain the size chart feature in detail across three articles.

Architecture

Size Chart Auto-Selection System
Product Page

Displays product info (category, gender, product type, etc.)

Get Metafields
Size Chart Selection Logic

Mapping table lookup・Priority evaluation・Normalization

Determine Chart ID
JSON Files

data/sizecharts/*.json

Vercel KV

Dynamic mapping changes

Key Features

  • Auto Selection: Automatically determines appropriate size chart from product category, type, and gender
  • Priority Control: Handle exceptions → SKU exceptions → Normal mapping → Fallback
  • Normalization: Absorbs notation variations (unifying "women", "woman", "ladies")
  • Dynamic Management: Mappings can be changed from admin panel
  • Size Guide Checker: Suggests sizes matching user's body measurements

Key Results

  • Centralized management of numerous size charts
  • Fully automated size chart configuration during product data updates
  • Improved user experience with size guide checker

Technologies Used

  • Shopify Storefront API (metafield retrieval)
  • Next.js (frontend, API Routes)
  • Vercel KV (dynamic mapping management)
  • TypeScript

Related Topics