Store Currency & Product Prices
Product prices in RAG chunks, chat replies, and product cards use the shop’s Shopify currency with symbols when available (e.g. $25,000, £30, Rs 25,000), not ISO codes like USD.
Related: Product sync & ingestion · RAG & chat API · Storefront product cards
How it works
Section titled “How it works”- Sync:
syncAllProductscallssyncShopCurrencyCode()→ readsshop.currencyCodefrom Shopify Admin API and stores it onshops.currency_code. - Ingestion: Product variant lines in chunks use
formatStoreMoney(price, currencyCode)(e.g.$25,000,£30,Rs 25,000—symbols when Intl provides them). - Chat:
generateChatReplypassesstoreCurrencyCodeinto the system prompt; existing chunks with legacy$labels are rewritten when building the prompt. - Product cards:
toProductCardPayloadformatspricewith the same helper. - Orders: Order lookup already uses
currencyCodefrom Shopify order money fields (unchanged).
Module: app/lib/store-currency.server.js.
Database
Section titled “Database”| Column | Type | Set when |
|---|---|---|
shops.currency_code | VARCHAR(3) nullable | Product sync (and can be refreshed each sync) |
Migration: 20260523130000_add_shop_currency_code.
Shopify variant price values are already in shop money; only display formatting was wrong.
Prompt rules
Section titled “Prompt rules”app/lib/prompt-builder.server.js includes a Store currency block and instructs the model to:
- Use prices exactly as in Store Context (e.g.
$25,000,£30,Rs 25,000). - Use currency symbols, not ISO codes (write
$notUSD,£notGBP) when a symbol is standard.
After deploy
Section titled “After deploy”npx prisma migrate deployRun Data sync → products (or full product sync) so currency_code is set and chunks are re-ingested with correct labels.
| File | Role |
|---|---|
app/lib/store-currency.server.js | formatStoreMoney, syncShopCurrencyCode, chunk $ → currency rewrite |
app/lib/chunker.server.js | Variant price lines in product chunks |
app/lib/product-cards.server.js | Card price string |
app/lib/rag.server.js | Loads shop.currencyCode, normalizes chunk text for prompt |
app/lib/product-sync.server.js | Syncs currency at start of product sync |
app/routes/api.chat.jsx | Selects currencyCode on shop for chat |