Skip to content

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


  1. Sync: syncAllProducts calls syncShopCurrencyCode() → reads shop.currencyCode from Shopify Admin API and stores it on shops.currency_code.
  2. Ingestion: Product variant lines in chunks use formatStoreMoney(price, currencyCode) (e.g. $25,000, £30, Rs 25,000—symbols when Intl provides them).
  3. Chat: generateChatReply passes storeCurrencyCode into the system prompt; existing chunks with legacy $ labels are rewritten when building the prompt.
  4. Product cards: toProductCardPayload formats price with the same helper.
  5. Orders: Order lookup already uses currencyCode from Shopify order money fields (unchanged).

Module: app/lib/store-currency.server.js.


ColumnTypeSet when
shops.currency_codeVARCHAR(3) nullableProduct 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.


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 $ not USD, £ not GBP) when a symbol is standard.

Terminal window
npx prisma migrate deploy

Run Data sync → products (or full product sync) so currency_code is set and chunks are re-ingested with correct labels.


FileRole
app/lib/store-currency.server.jsformatStoreMoney, syncShopCurrencyCode, chunk $ → currency rewrite
app/lib/chunker.server.jsVariant price lines in product chunks
app/lib/product-cards.server.jsCard price string
app/lib/rag.server.jsLoads shop.currencyCode, normalizes chunk text for prompt
app/lib/product-sync.server.jsSyncs currency at start of product sync
app/routes/api.chat.jsxSelects currencyCode on shop for chat