saleor-storefront

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Saleor Storefront

Saleor 店面

Universal guide for building storefronts on the Saleor e-commerce platform. Covers the Saleor GraphQL API data model, permission system, checkout lifecycle, channel architecture, and product/variant patterns. Framework-agnostic — these rules apply whether you're using Next.js, Remix, Nuxt, or a custom setup.
为在Saleor电商平台上构建店面提供的通用指南。涵盖Saleor GraphQL API数据模型、权限系统、结账生命周期、渠道架构以及产品/变体模式。与框架无关——无论你使用Next.js、Remix、Nuxt还是自定义配置,这些规则都适用。

When to Apply

适用场景

Reference these guidelines when:
  • Querying Saleor's GraphQL API for products, categories, or collections
  • Building product detail pages with variant selection
  • Implementing checkout and payment flows
  • Working with multi-channel and multi-currency setups
  • Debugging "product not purchasable" or permission errors
  • Investigating Saleor API behavior via source code
在以下场景中参考本指南:
  • 查询Saleor的GraphQL API获取产品、分类或集合
  • 构建包含变体选择的产品详情页
  • 实现结账和支付流程
  • 处理多渠道和多货币设置
  • 调试“产品不可购买”或权限错误
  • 通过源代码排查Saleor API行为

Rule Categories

规则分类

PriorityCategoryImpactPrefix
1APICRITICAL
api-
2ProductsHIGH
products-
3CheckoutHIGH
checkout-
4ChannelsMEDIUM
channels-
优先级分类影响级别前缀
1API关键
api-
2产品
products-
3结账
checkout-
4渠道
channels-

Quick Reference

快速参考

1. API (CRITICAL)

1. API(关键)

  • api-data-model
    — Nullable fields, pricing structure, automatic storefront filtering
  • api-permissions
    — Token types, permission errors, two-tier query pattern
  • api-graphql-patterns
    — Channel-scoped queries, variant attributes, filtering, codegen
  • api-investigation
    — How to investigate Saleor API behavior via types and source
  • api-data-model
    — 可空字段、定价结构、店面自动过滤
  • api-permissions
    — 令牌类型、权限错误、双层查询模式
  • api-graphql-patterns
    — 渠道范围查询、变体属性、过滤、代码生成
  • api-investigation
    — 如何通过类型和源代码排查Saleor API行为

2. Products (HIGH)

2. 产品(高)

  • products-variants
    — Variant model, selection vs non-selection attributes, pricing, UX patterns
  • products-variants
    — 变体模型、可选与非可选属性、定价、UX模式

3. Checkout (HIGH)

3. 结账(高)

  • checkout-lifecycle
    — Session lifecycle, common errors, debugging payment issues
  • checkout-lifecycle
    — 会话生命周期、常见错误、调试支付问题

4. Channels (MEDIUM)

4. 渠道(中)

  • channels-purchasability
    — Fulfillment triangle, 7-point purchasability checklist, channel queries
  • channels-purchasability
    — 履约三角、7点可购买性检查清单、渠道查询

How to Use

使用方法

Read individual rule files for detailed explanations and code examples:
rules/api-data-model.md
rules/products-variants.md
Each rule file contains:
  • Brief explanation of why it matters
  • Code examples (correct and incorrect patterns)
  • Anti-patterns to avoid
阅读单个规则文件获取详细说明和代码示例:
rules/api-data-model.md
rules/products-variants.md
每个规则文件包含:
  • 简要说明其重要性
  • 代码示例(正确与错误模式)
  • 需要避免的反模式

Full Compiled Document

完整编译文档

For the complete guide with all rules expanded:
AGENTS.md
如需包含所有扩展规则的完整指南,请查看:
AGENTS.md