creating-b2b-commerce-store
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCommerce B2B Storefront Creation
Commerce B2B店面创建
Interactive workflow to create a Commerce B2B Store in Salesforce and retrieve the auto-generated storefront metadata to your repository.
用于在Salesforce中创建Commerce B2B商店并将自动生成的店面元数据检索到您的代码仓库的交互式工作流。
Critical Concepts
核心概念
Commerce B2B = Store (backend data) + Storefront (frontend metadata). Store must be created first in the org to auto-generate the Storefront. Never create storefront metadata manually.
See Store vs Storefront Reference
Commerce B2B = Store(后端数据) + Storefront(前端元数据)。必须先在组织中创建Store,才能自动生成Storefront。切勿手动创建店面元数据。
参考:Store vs Storefront 参考文档
When to Use This Skill
何时使用此Skill
Trigger when users request:
- "Create a B2B Commerce store"
- "Build a Commerce storefront"
- "Set up Commerce B2B"
- "Create B2B Commerce"
- "Retrieve Commerce storefront metadata"
- "Deploy B2B storefront"
当用户提出以下请求时触发:
- "创建B2B Commerce商店"
- "构建Commerce店面"
- "设置Commerce B2B"
- "创建B2B Commerce"
- "检索Commerce店面元数据"
- "部署B2B店面"
Rules That Always Apply
始终适用的规则
-
Always follow the interactive flow. Do NOT skip steps. Each step requires user confirmation before proceeding.
-
Never create storefront metadata manually. The Commerce setup wizard generates hundreds of configuration values. Manual creation will fail.
-
Always list sites before retrieval. Store names get underscores and number suffixes (e.g., "My B2B Store" → "My_B2B_Store1"). Let the user select from the actual list.
-
Always useflag. Include
--jsonon all Salesforce CLI commands for parseable output.--json
-
始终遵循交互式流程。请勿跳过步骤。每一步都需要用户确认后才能继续。
-
切勿手动创建店面元数据。Commerce设置向导会生成数百个配置值。手动创建会失败。
-
检索前始终列出站点。商店名称会被替换为下划线和数字后缀(例如,"My B2B Store" → "My_B2B_Store1")。让用户从实际列表中选择。
-
始终使用标志。在所有Salesforce CLI命令中包含
--json以获得可解析的输出。--json
Interactive Workflow: 7 Steps
交互式工作流:7个步骤
Step 1: Explain Commerce B2B Concept
步骤1:解释Commerce B2B概念
Agent explains: Commerce has Store (data) + Storefront (metadata). Store must be created first.
See: Store vs Storefront Reference
Agent说明:Commerce包含Store(数据)+ Storefront(元数据)。必须先创建Store。
参考:Store vs Storefront 参考文档
Step 2: Guide User to Create B2B Store
步骤2:引导用户创建B2B Store
Agent provides these steps:
-
Navigate to Setup → Commerce → Stores
- Or: App Launcher → Commerce → Create Store
-
Click "Create Store" or "Setup New Store"
-
Select "Commerce Store" as the store type
-
Follow the wizard:
- Store Name: Choose descriptive name (e.g., "My B2B Store")
- Important: Spaces become underscores in folder names
- Site URL: Unique URL name for the site
- Store Name: Choose descriptive name (e.g., "My B2B Store")
-
Complete wizard - it creates:
- WebStore record
- Default buyer group and entitlement policies
- Associated Digital Experience (LWR site)
-
Optional: Configure payment gateway, tax provider, shipping
Agent then asks:
"Have you completed creating the B2B Store in your org? Reply 'yes' when ready and provide the store name you used."
Agent提供以下步骤:
-
导航至 Setup → Commerce → Stores
- 或:App Launcher → Commerce → Create Store
-
点击 "Create Store" 或 "Setup New Store"
-
选择 "Commerce Store" 作为商店类型
-
按照向导操作:
- Store Name:选择描述性名称(例如,"My B2B Store")
- 重要提示:空格会在文件夹名称中变为下划线
- Site URL:站点的唯一URL名称
- Store Name:选择描述性名称(例如,"My B2B Store")
-
完成向导后,将创建:
- WebStore记录
- 默认买家组和权限策略
- 关联的Digital Experience(LWR站点)
-
可选:配置支付网关、税务提供商、配送方式
Agent随后询问:
"您是否已在组织中完成B2B Store的创建?准备好后回复'yes'并提供您使用的商店名称。"
Step 3: Get User Confirmation
步骤3:获取用户确认
Agent waits for: User confirmation and store name
Agent validates: Store name format (no special characters, spaces will appear as underscores)
Agent acknowledges: "Great! Let me list the available storefronts in your org..."
Agent等待:用户确认和商店名称
Agent验证:商店名称格式(无特殊字符,空格会显示为下划线)
Agent确认:"好的!让我列出您组织中可用的店面..."
Step 4: List Available LWR Sites
步骤4:列出可用的LWR站点
Agent executes:
bash
sf org list metadata --metadata-type DigitalExperienceConfig --jsonAgent should:
- Parse JSON output to extract site names
- Display as numbered list
- Explain naming (underscores, number suffixes)
Example output:
Available Digital Experience sites:
1. My_B2B_Store1
2. Partner_Portal
3. Customer_CommunityAgent执行:
bash
sf org list metadata --metadata-type DigitalExperienceConfig --jsonAgent应:
- 解析JSON输出以提取站点名称
- 以编号列表形式显示
- 解释命名规则(下划线、数字后缀)
示例输出:
可用的Digital Experience站点:
1. My_B2B_Store1
2. Partner_Portal
3. Customer_CommunityStep 5: Let User Select Storefront
步骤5:让用户选择店面
Agent asks:
"Which site corresponds to your B2B Store? Select the site name:"
Agent validates: Selection matches available sites
Agent confirms: "Got it! I'll retrieve metadata for [site-name]..."
Agent询问:
"哪个站点对应您的B2B Store?请选择站点名称:"
Agent验证:所选站点与可用站点匹配
Agent确认:"收到!我将检索[站点名称]的元数据..."
Step 6: Retrieve Storefront Metadata
步骤6:检索店面元数据
Agent executes:
bash
sf project retrieve start -m DigitalExperienceBundle:site/<selected-store-name> --jsonAgent should:
- Show retrieval progress
- Confirm successful retrieval
- List retrieved directory structure
Expected output:
Retrieved: force-app/main/default/digitalExperiences/site/My_B2B_Store1/
├── My_B2B_Store1.digitalExperience-meta.xml
├── sfdc_cms__view/ (home, current_cart, detail_*, list_*, etc.)
├── sfdc_cms__site/
├── sfdc_cms__route/
└── [other sfdc_cms__* directories]Agent执行:
bash
sf project retrieve start -m DigitalExperienceBundle:site/<selected-store-name> --jsonAgent应:
- 显示检索进度
- 确认检索成功
- 列出检索到的目录结构
预期输出:
已检索:force-app/main/default/digitalExperiences/site/My_B2B_Store1/
├── My_B2B_Store1.digitalExperience-meta.xml
├── sfdc_cms__view/ (home, current_cart, detail_*, list_*, etc.)
├── sfdc_cms__site/
├── sfdc_cms__route/
└── [其他sfdc_cms__*目录]Step 7: Provide Next Steps
步骤7:提供后续步骤
Agent provides:
✅ Metadata retrieved successfully!
Next steps:
- Customize with custom LWCs or branding changes
- Deploy:
sf project deploy start --source-dir force-app/main/default/digitalExperiences/site/My_B2B_Store1/ --json
Resources: DigitalExperienceBundle Docs, B2B Commerce Guide
Agent提供:
✅ 元数据检索成功!
后续步骤:
- 使用自定义LWC或品牌变更进行定制
- 部署:
sf project deploy start --source-dir force-app/main/default/digitalExperiences/site/My_B2B_Store1/ --json
Reference
参考文档
- store-vs-storefront.md - Technical details on Store vs Storefront, source control, and why manual creation fails
- store-vs-storefront.md - 关于Store与Storefront、源代码控制以及手动创建失败原因的技术细节
Remember
请记住
Store first (creates storefront) → Retrieve → Customize
先创建Store(自动生成店面)→ 检索元数据 → 定制