@davoodmehraban89 / medusa / commits / 2a2ef087
Fork 0

feat(preview): add clearly labeled multilingual example categories without fictitious stock or prices

davoodmehraban89 committed Oct 15, 2026 at 01:24 UTC 2a2ef087216084c4d3348b177bbb79ebb4284103
1 file changed +66
commerce/src/preview/products.ts new
+66
@@ -0,0 +1,66 @@
1 +import type { MarketCode, StoreLocale } from "../config/markets"
2 +
3 +/**
4 + * Illustrative examples ONLY. No SKU, live stock, seller, price, customs
5 + * eligibility or fulfillment claim is implied by these entries.
6 + */
7 +export type PreviewKind = "electronics" | "iranian"
8 +export type PreviewVisual = "phone" | "laptop" | "headphones" | "camera" | "tea" | "ceramic" | "textile" | "saffron"
9 +
10 +export type PreviewProduct = {
11 + id: string
12 + kind: PreviewKind
13 + visual: PreviewVisual
14 + markets: readonly MarketCode[]
15 + name: Record<StoreLocale, string>
16 + description: Record<StoreLocale, string>
17 +}
18 +
19 +const ALL_MARKETS: readonly MarketCode[] = ["IR", "AE", "OM", "IQ", "QA"]
20 +
21 +export const PREVIEW_PRODUCTS: readonly PreviewProduct[] = [
22 + {
23 + id: "example-phone", kind: "electronics", visual: "phone", markets: ["IR"],
24 + name: { "fa-IR": "گوشی هوشمند", ar: "هاتف ذكي", en: "Smartphone" },
25 + description: { "fa-IR": "نمایشی از دسته موبایل و لوازم دیجیتال", ar: "معاينة لفئة الهواتف والإلكترونيات", en: "Illustrating the mobile and digital category" },
26 + },
27 + {
28 + id: "example-laptop", kind: "electronics", visual: "laptop", markets: ["IR"],
29 + name: { "fa-IR": "لپ‌تاپ و رایانه", ar: "حاسوب محمول", en: "Laptop & computing" },
30 + description: { "fa-IR": "نمونه چیدمان محصولات رایانه‌ای", ar: "نموذج لعرض منتجات الحاسوب", en: "Example layout for computing products" },
31 + },
32 + {
33 + id: "example-audio", kind: "electronics", visual: "headphones", markets: ["IR"],
34 + name: { "fa-IR": "لوازم صوتی", ar: "ملحقات صوتية", en: "Audio accessories" },
35 + description: { "fa-IR": "دسته‌بندی نمونه هدفون و تجهیزات صوتی", ar: "مثال على فئة سماعات الرأس والصوت", en: "Sample audio and headphone category" },
36 + },
37 + {
38 + id: "example-camera", kind: "electronics", visual: "camera", markets: ["IR"],
39 + name: { "fa-IR": "تصویربرداری", ar: "التصوير", en: "Imaging" },
40 + description: { "fa-IR": "نمایشی از محصولات دوربین و تصویر", ar: "معاينة لمنتجات التصوير", en: "Preview of camera and imaging categories" },
41 + },
42 + {
43 + id: "example-tea", kind: "iranian", visual: "tea", markets: ALL_MARKETS,
44 + name: { "fa-IR": "چای ایرانی", ar: "الشاي الإيراني", en: "Iranian tea" },
45 + description: { "fa-IR": "نمونه دسته محصولات خوراکی منتخب ایران", ar: "نموذج لفئة الأغذية الإيرانية المختارة", en: "Illustrative Iran-origin grocery category" },
46 + },
47 + {
48 + id: "example-ceramic", kind: "iranian", visual: "ceramic", markets: ALL_MARKETS,
49 + name: { "fa-IR": "سفال و سرامیک", ar: "الفخار والخزف", en: "Pottery & ceramics" },
50 + description: { "fa-IR": "نمایش نمونه برای صنایع دستی ایرانی", ar: "عرض توضيحي للحرف اليدوية الإيرانية", en: "Example of Iranian handicraft merchandising" },
51 + },
52 + {
53 + id: "example-textile", kind: "iranian", visual: "textile", markets: ALL_MARKETS,
54 + name: { "fa-IR": "منسوجات دست‌باف", ar: "المنسوجات اليدوية", en: "Handwoven textiles" },
55 + description: { "fa-IR": "نمونه گروه هنرهای پارچه‌ای و دست‌باف", ar: "مثال على المنسوجات والفنون اليدوية", en: "Illustrative woven and textile collection" },
56 + },
57 + {
58 + id: "example-saffron", kind: "iranian", visual: "saffron", markets: ALL_MARKETS,
59 + name: { "fa-IR": "زعفران و ادویه", ar: "الزعفران والتوابل", en: "Saffron & spices" },
60 + description: { "fa-IR": "نمایش نمونه محصولات کشاورزی منتخب", ar: "معاينة لمحاصيل زراعية مختارة", en: "Example of selected agricultural products" },
61 + },
62 +]
63 +
64 +export function previewProductsForMarket(market: MarketCode): PreviewProduct[] {
65 + return PREVIEW_PRODUCTS.filter((product) => product.markets.includes(market))
66 +}