Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Show the data source picker even with nothing to switch to
Damian Legawiec410ce017c4b2
diff --git a/packages/dashboard/src/locales/ar.json b/packages/dashboard/src/locales/ar.jsonindex 5c21bbea17..dac524df4d 100644--- a/packages/dashboard/src/locales/ar.json+++ b/packages/dashboard/src/locales/ar.json@@ -1598,11 +1598,13 @@"not_connected": "اربط هذا التكامل لاستخدامه","pricing_provider": {"label": "مصدر الأسعار",- "help": "يسعّر Spree من الكتالوج وقوائم الأسعار ما لم يجب نظام خارجي."+ "help": "يسعّر Spree من الكتالوج وقوائم الأسعار ما لم يجب نظام خارجي.",+ "docs_link": "إنشاء مزوّد أسعار"},"inventory_provider": {"label": "مصدر المخزون",- "help": "يُسأل المصدر الخارجي عند الإضافة إلى السلة وعند الدفع. تعرض القوائم دائمًا سجلات مخزونك."+ "help": "يُسأل المصدر الخارجي عند الإضافة إلى السلة وعند الدفع. تعرض القوائم دائمًا سجلات مخزونك.",+ "docs_link": "إنشاء مزوّد مخزون"},"pricing_failure_policy": {"label": "إذا تعذر تأكيد الأسعار",@@ -1619,7 +1621,8 @@"fallback": {"label": "استخدم أرقام Spree"}- }+ },+ "description": "يقدّم Spree الأسعار والمخزون من سجلاته الخاصة. اربط نظام ERP أو PIM أو نظام مستودع ليتولى الإجابة بدلاً منه."}},"store_credit": {diff --git a/packages/dashboard/src/locales/de.json b/packages/dashboard/src/locales/de.jsonindex cfe61a6478..d001f9c5b8 100644--- a/packages/dashboard/src/locales/de.json+++ b/packages/dashboard/src/locales/de.json@@ -1583,11 +1583,13 @@"not_connected": "Verbinden Sie diese Integration, um sie zu nutzen","pricing_provider": {"label": "Preise stammen aus",- "help": "Spree berechnet Preise aus Ihrem Katalog und Ihren Preislisten, sofern kein externes System antwortet."+ "help": "Spree berechnet Preise aus Ihrem Katalog und Ihren Preislisten, sofern kein externes System antwortet.",+ "docs_link": "Einen Preis-Provider erstellen"},"inventory_provider": {"label": "Bestände stammen aus",- "help": "Eine externe Quelle wird beim Hinzufügen zum Warenkorb und an der Kasse gefragt. Listen zeigen immer Ihre eigenen Bestände."+ "help": "Eine externe Quelle wird beim Hinzufügen zum Warenkorb und an der Kasse gefragt. Listen zeigen immer Ihre eigenen Bestände.",+ "docs_link": "Einen Bestands-Provider erstellen"},"pricing_failure_policy": {"label": "Wenn Preise nicht bestätigt werden können",@@ -1604,7 +1606,8 @@"fallback": {"label": "Sprees eigene Zahlen verwenden"}- }+ },+ "description": "Spree liefert Preise und Bestände aus den eigenen Datensätzen. Verbinden Sie ein ERP-, PIM- oder Lagersystem, damit dieses stattdessen antwortet."}},"store_credit": {diff --git a/packages/dashboard/src/locales/en.json b/packages/dashboard/src/locales/en.jsonindex d3786702fb..4043137dcc 100644--- a/packages/dashboard/src/locales/en.json+++ b/packages/dashboard/src/locales/en.json@@ -1583,11 +1583,13 @@"not_connected": "Connect this integration to use it","pricing_provider": {"label": "Prices come from",- "help": "Spree prices from your catalog and price lists unless an external system answers instead."+ "help": "Spree prices from your catalog and price lists unless an external system answers instead.",+ "docs_link": "Build a pricing provider"},"inventory_provider": {"label": "Stock levels come from",- "help": "An external source is asked when an item is added to a cart and at checkout. Listings always show your own stock records."+ "help": "An external source is asked when an item is added to a cart and at checkout. Listings always show your own stock records.",+ "docs_link": "Build an inventory provider"},"pricing_failure_policy": {"label": "If prices cannot be confirmed",@@ -1604,7 +1606,8 @@"fallback": {"label": "Use Spree's own figures"}- }+ },+ "description": "Spree serves prices and stock from its own records. Connect an ERP, PIM or warehouse system to have it answer instead."}},"store_credit": {diff --git a/packages/dashboard/src/locales/fr.json b/packages/dashboard/src/locales/fr.jsonindex 7211f1d174..0f75ee11ee 100644--- a/packages/dashboard/src/locales/fr.json+++ b/packages/dashboard/src/locales/fr.json@@ -1583,11 +1583,13 @@"not_connected": "Connectez cette intégration pour l’utiliser","pricing_provider": {"label": "Les prix proviennent de",- "help": "Spree calcule les prix depuis votre catalogue et vos listes de prix, sauf si un système externe répond."+ "help": "Spree calcule les prix depuis votre catalogue et vos listes de prix, sauf si un système externe répond.",+ "docs_link": "Créer un fournisseur de prix"},"inventory_provider": {"label": "Les stocks proviennent de",- "help": "Une source externe est interrogée à l’ajout au panier et au paiement. Les listes affichent toujours vos propres stocks."+ "help": "Une source externe est interrogée à l’ajout au panier et au paiement. Les listes affichent toujours vos propres stocks.",+ "docs_link": "Créer un fournisseur de stock"},"pricing_failure_policy": {"label": "Si les prix ne peuvent être confirmés",@@ -1604,7 +1606,8 @@"fallback": {"label": "Utiliser les chiffres de Spree"}- }+ },+ "description": "Spree fournit les prix et les stocks à partir de ses propres enregistrements. Connectez un ERP, un PIM ou un système d'entrepôt pour qu'il réponde à la place."}},"store_credit": {diff --git a/packages/dashboard/src/locales/pl.json b/packages/dashboard/src/locales/pl.jsonindex c5d6974dcf..e13b744162 100644--- a/packages/dashboard/src/locales/pl.json+++ b/packages/dashboard/src/locales/pl.json@@ -1599,11 +1599,13 @@"not_connected": "Połącz tę integrację, aby jej użyć","pricing_provider": {"label": "Źródło cen",- "help": "Spree wylicza ceny z katalogu i cenników, chyba że odpowiada system zewnętrzny."+ "help": "Spree wylicza ceny z katalogu i cenników, chyba że odpowiada system zewnętrzny.",+ "docs_link": "Zbuduj dostawcę cen"},"inventory_provider": {"label": "Źródło stanów magazynowych",- "help": "Źródło zewnętrzne jest pytane przy dodaniu do koszyka i przy zamówieniu. Listy zawsze pokazują Twoje własne stany."+ "help": "Źródło zewnętrzne jest pytane przy dodaniu do koszyka i przy zamówieniu. Listy zawsze pokazują Twoje własne stany.",+ "docs_link": "Zbuduj dostawcę stanów magazynowych"},"pricing_failure_policy": {"label": "Gdy nie można potwierdzić cen",@@ -1620,7 +1622,8 @@"fallback": {"label": "Użyj danych Spree"}- }+ },+ "description": "Spree podaje ceny i stany magazynowe z własnych danych. Podłącz system ERP, PIM lub magazynowy, aby to on udzielał odpowiedzi."}},"store_credit": {diff --git a/packages/dashboard/src/locales/zh-CN.json b/packages/dashboard/src/locales/zh-CN.jsonindex 7024b59466..4ade6a089f 100644--- a/packages/dashboard/src/locales/zh-CN.json+++ b/packages/dashboard/src/locales/zh-CN.json@@ -1580,11 +1580,13 @@"not_connected": "连接此集成后方可使用","pricing_provider": {"label": "价格来源",- "help": "除非有外部系统作答,否则 Spree 按您的目录和价格表定价。"+ "help": "除非有外部系统作答,否则 Spree 按您的目录和价格表定价。",+ "docs_link": "构建价格数据源"},"inventory_provider": {"label": "库存来源",- "help": "加入购物车和结账时会询问外部来源。列表始终显示您自己的库存记录。"+ "help": "加入购物车和结账时会询问外部来源。列表始终显示您自己的库存记录。",+ "docs_link": "构建库存数据源"},"pricing_failure_policy": {"label": "无法确认价格时",@@ -1601,7 +1603,8 @@"fallback": {"label": "使用 Spree 自己的数据"}- }+ },+ "description": "Spree 使用自身记录提供价格和库存。连接 ERP、PIM 或仓储系统后,可改由其提供数据。"}},"store_credit": {diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/store.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/store.tsxindex 97a909a757..a4fbdacdf8 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/store.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/store.tsx@@ -14,6 +14,7 @@ import {import {Card,CardContent,+ CardDescription,CardHeader,CardTitle,ErrorState,@@ -36,7 +37,8 @@ import {useFormSubmitShortcut,} from '@spree/dashboard-ui'import { createFileRoute } from '@tanstack/react-router'-import { useCallback, useEffect, useMemo } from 'react'+import { ExternalLinkIcon } from 'lucide-react'+import { type ReactNode, useCallback, useEffect, useMemo } from 'react'import {type Control,Controller,@@ -69,6 +71,25 @@ export const Route = createFileRoute('/_authenticated/$storeId/settings/store')(component: StoreSettingsPage,})+const PRICING_PROVIDER_DOCS_URL =+ 'https://spreecommerce.org/docs/v6/developer/how-to/custom-pricing-provider'+const INVENTORY_PROVIDER_DOCS_URL =+ 'https://spreecommerce.org/docs/v6/developer/how-to/custom-inventory-provider'++function DocsLink({ href, children }: { href: string; children: ReactNode }) {+ return (+ <a+ href={href}+ target="_blank"+ rel="noopener noreferrer"+ className="inline-flex items-center gap-1 text-primary text-sm hover:underline"+ >+ {children}+ <ExternalLinkIcon className="size-3.5" />+ </a>+ )+}+const TIMEZONES: string[] = (() => {try {return Intl.supportedValuesOf('timeZone')@@ -170,13 +191,6 @@ function StoreSettingsForm({ store }: { store: Store }) {const switchAdminLocale = useSwitchAdminLocale()const { data: dataSources } = useStoreDataSources()- // The card stays hidden until a connector gem is installed: a store with- // only Spree's own engines has nothing to choose between, and a select with- // one option is noise on a settings page.- const hasExternalDataSources =- (dataSources?.pricing_providers.length ?? 0) + (dataSources?.inventory_providers.length ?? 0) >- 2-const form = useForm<StoreSettingsFormValues>({// eslint-disable-next-line @typescript-eslint/no-explicit-anyresolver: zodResolver(storeSettingsFormSchema) as any,@@ -703,49 +717,58 @@ function StoreSettingsForm({ store }: { store: Store }) {</FieldGroup></CardContent></Card>- {hasExternalDataSources && (- <Card>- <CardHeader>- <CardTitle>{t('admin.pages.settings.store.tab_data_sources')}</CardTitle>- </CardHeader>- <CardContent>- <FieldGroup>- <SelectField- id="store-pricing-provider"- label={t('admin.fields.store.data_sources.pricing_provider.label')}- help={t('admin.fields.store.data_sources.pricing_provider.help')}- name="preferred_pricing_provider"- control={form.control}- options={providerOptions(dataSources?.pricing_providers)}- />- <SelectField- id="store-pricing-failure-policy"- label={t('admin.fields.store.data_sources.pricing_failure_policy.label')}- help={t('admin.fields.store.data_sources.pricing_failure_policy.help')}- name="preferred_pricing_provider_failure_policy"- control={form.control}- options={failurePolicyOptions}- />- <SelectField- id="store-inventory-provider"- label={t('admin.fields.store.data_sources.inventory_provider.label')}- help={t('admin.fields.store.data_sources.inventory_provider.help')}- name="preferred_inventory_provider"- control={form.control}- options={providerOptions(dataSources?.inventory_providers)}- />- <SelectField- id="store-inventory-failure-policy"- label={t('admin.fields.store.data_sources.inventory_failure_policy.label')}- help={t('admin.fields.store.data_sources.inventory_failure_policy.help')}- name="preferred_inventory_provider_failure_policy"- control={form.control}- options={failurePolicyOptions}- />- </FieldGroup>- </CardContent>- </Card>- )}+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.pages.settings.store.tab_data_sources')}</CardTitle>+ <CardDescription>+ {t('admin.fields.store.data_sources.description')}+ </CardDescription>+ </CardHeader>+ <CardContent>+ <FieldGroup>+ <SelectField+ id="store-pricing-provider"+ label={t('admin.fields.store.data_sources.pricing_provider.label')}+ help={t('admin.fields.store.data_sources.pricing_provider.help')}+ name="preferred_pricing_provider"+ control={form.control}+ options={providerOptions(dataSources?.pricing_providers)}+ />+ <SelectField+ id="store-pricing-failure-policy"+ label={t('admin.fields.store.data_sources.pricing_failure_policy.label')}+ help={t('admin.fields.store.data_sources.pricing_failure_policy.help')}+ name="preferred_pricing_provider_failure_policy"+ control={form.control}+ options={failurePolicyOptions}+ />+ <SelectField+ id="store-inventory-provider"+ label={t('admin.fields.store.data_sources.inventory_provider.label')}+ help={t('admin.fields.store.data_sources.inventory_provider.help')}+ name="preferred_inventory_provider"+ control={form.control}+ options={providerOptions(dataSources?.inventory_providers)}+ />+ <SelectField+ id="store-inventory-failure-policy"+ label={t('admin.fields.store.data_sources.inventory_failure_policy.label')}+ help={t('admin.fields.store.data_sources.inventory_failure_policy.help')}+ name="preferred_inventory_provider_failure_policy"+ control={form.control}+ options={failurePolicyOptions}+ />+ </FieldGroup>+ <div className="mt-6 flex flex-col gap-2 border-t pt-4 sm:flex-row sm:gap-6">+ <DocsLink href={PRICING_PROVIDER_DOCS_URL}>+ {t('admin.fields.store.data_sources.pricing_provider.docs_link')}+ </DocsLink>+ <DocsLink href={INVENTORY_PROVIDER_DOCS_URL}>+ {t('admin.fields.store.data_sources.inventory_provider.docs_link')}+ </DocsLink>+ </div>+ </CardContent>+ </Card><Card><CardHeader><CardTitle>{t('admin.pages.settings.store.tab_catalog')}</CardTitle>