saleor-core
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSaleor Core
Saleor Core
Backend behavior reference derived from the Saleor core source code. Covers
internal mechanics that aren't fully documented in the public API reference —
discount precedence, stacking rules, denormalized fields, and known Dashboard
gotchas.
基于Saleor核心源代码整理的后端行为参考。涵盖了公开API参考中未完整记录的内部机制——折扣优先级、叠加规则、非规范化字段,以及已知的Dashboard问题。
When to Apply
适用场景
- Building or debugging discount/promotion UI in the Dashboard
- Investigating why a voucher or promotion isn't applying
- Understanding order-level vs line-level discount precedence
- Working with /
OrderDiscountobjectsOrderLineDiscount - Debugging on
unit_discount_valueOrderLine - Deciding whether discounts stack or suppress each other
- 在Dashboard中构建或调试折扣/促销UI
- 排查优惠券或促销活动无法生效的问题
- 理解订单级与商品行级折扣的优先级
- 处理/
OrderDiscount对象OrderLineDiscount - 调试中的
OrderLine字段unit_discount_value - 判断折扣是否可叠加或相互抑制
Rule Categories
规则分类
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Discounts | CRITICAL | |
| 优先级 | 分类 | 影响级别 | 前缀 |
|---|---|---|---|
| 1 | 折扣规则 | 关键 | |
Quick Reference
快速参考
1. Discounts (CRITICAL)
1. 折扣规则(关键)
- — Full precedence hierarchy, stacking rules, manual vs voucher vs promotion interactions, denormalized field semantics, known Dashboard bug
discount-precedence
- — 完整的优先级层级、叠加规则、手动折扣与优惠券/促销活动的交互逻辑、非规范化字段语义、已知的Dashboard bug
discount-precedence
How to Use
使用方法
Read individual rule files for detailed explanations and source-level evidence:
rules/discount-precedence.mdEach rule file contains:
- Precedence hierarchy with stacking matrix
- Source code references from with function names and file paths
saleor/ - Anti-patterns and known bugs
阅读单个规则文件以获取详细说明和源代码层面的依据:
rules/discount-precedence.md每个规则文件包含:
- 带有叠加矩阵的优先级层级
- 来自目录的源代码参考,包含函数名和文件路径
saleor/ - 反模式示例与已知bug