← back to Dw Product Class
README.md
28 lines
# DW Product Class + Specs
Adds a clean top-level classification to every active Designer Wallcoverings
Shopify product and surfaces product specs on the storefront.
## Phase 1 — Data (DONE)
- Metafield `custom.product_class` (single-line text) = **Wallcovering | Fabric | Other**.
- `classify.sql` builds the `dw_unified.dw_product_class` staging table from the
`shopify_products` mirror (ACTIVE only) via a deterministic product_type map
with sample-tag inheritance.
- `push_class.py` bulk-writes the metafield to LIVE Shopify via GraphQL
`metafieldsSet` (BATCH env, default 25; canary + repair at BATCH=1).
`metafieldsSet` is transactional per call, so one deleted owner rejects its
whole batch — the BATCH=1 repair pass isolates the ghosts.
Result: 79,691 products classified (Wallcovering 60,342 / Fabric 18,103 /
Other 1,246); 8 stale owners deleted-from-Shopify, skipped.
## Phase 2 — Storefront (pending theme access)
- `product-specs.liquid` — right-column block: the class badge + a
Specifications `<dl>` (Pattern, Collection, Brand, Width, Repeats, Content,
Durability, Cleaning Code, Use, Direction, Country of Origin, Weight,
Prop 65, CA TB117). Renders only populated rows. Reads `custom.product_class`
+ legacy `global.*` spec metafields.
- Requires `write_themes` scope on the custom app (or manual paste in the theme editor).
Store: `designer-laboratory-sandbox.myshopify.com` (the LIVE DW store).