Promotion Engine
Overview
This skill looks up active promotions and calculates final prices.
It always shows its work (calculation steps) so customers trust the answer.
Depends on: promotions[] in knowledge base + membership{} config.
Query Types
| Query | Example | Action |
|---|
| "What promotions are active?" | "现在有什么活动?" | List all active promos |
| "How much will I pay?" |
"买两件怎么算?" | Calculate total |
| "Is this on sale?" | "这款打折吗?" | Check promo applicability |
| "How do I get the best deal?" | "怎么买最划算?" | Optimize purchase strategy |
| "Can I stack promos?" | "会员折扣和满减可以一起用吗?" | Check stackability |
Calculation Steps
Always show calculation steps. Customers distrust "magic numbers."
Step 1: Identify applicable promotions
For each item in the cart/query:
- 1. Check
promotions[] for active promos (not expired) - Filter by
applicable_to scope (does this product qualify?) - Check
excluded list (is this product excluded?) - Check membership tier for additional discounts
Step 2: Apply promotion rules
Use scripts/calculate_promotion.py for accurate computation.
Promotion types:
| Type | Rule format | Example |
|---|
| INLINECODE6 | 满X减Y | 满300减50 |
| INLINECODE7 |
X折 or X% off | 8折, 20% off |
|
bundle | 买X件享Y价 | 买2件第2件半价 |
|
gift | 满X赠品 | 满200赠小样 |
|
member_price | 会员专属价 | VIP价¥199 |
Step 3: Handle stacking
Check
stackable field on each promotion.
- -
stackable: true → can combine with others - INLINECODE13 → use highest-value single promo
- When in doubt: use the rule that benefits the customer more
Step 4: Present result
Show original price → applicable promos → final price → total savings.
Answer Format
Single item query
CODEBLOCK0
Cart calculation
CODEBLOCK1
No active promotions
目前[产品/全场]暂无特别优惠活动。
当前售价:¥[price]
Edge Cases
Conflicting promos: Always apply the rule that benefits the customer most. State which was applied.
Expired promo mentioned by customer: "这个活动已于[date]结束了,目前[有/没有]新的优惠。"
Promo not in KB but customer claims it exists: "我目前没有查到这个活动的信息,建议向店员确认一下,以免信息有误。"
Membership tier unknown: "您的会员等级我暂时查不到,建议核实后,会员专属折扣会自动应用。"
Script
Use scripts/calculate_promotion.py for accurate numeric calculation.
Reference: promo-rules-guide.md — detailed rule parsing.
促销引擎
概述
本技能用于查询当前有效促销活动并计算最终价格。始终展示计算过程(计算步骤),让客户信任结果。
依赖项: 知识库中的 promotions[] + membership{} 配置。
查询类型
| 查询 | 示例 | 操作 |
|---|
| 当前有哪些促销活动? | 现在有什么活动? | 列出所有有效促销 |
| 我需要付多少钱? |
买两件怎么算? | 计算总价 |
| 这款商品在打折吗? | 这款打折吗? | 检查促销适用性 |
| 怎么买最划算? | 怎么买最划算? | 优化购买策略 |
| 促销可以叠加吗? | 会员折扣和满减可以一起用吗? | 检查可叠加性 |
计算步骤
始终展示计算步骤。客户不信任凭空出现的数字。
步骤1:识别适用的促销活动
针对购物车/查询中的每件商品:
- 1. 检查 promotions[] 中的有效促销(未过期)
- 按 applicable_to 范围筛选(该商品是否符合条件?)
- 检查 excluded 列表(该商品是否被排除?)
- 检查会员等级是否有额外折扣
步骤2:应用促销规则
使用 scripts/calculate_promotion.py 进行精确计算。
促销类型:
| 类型 | 规则格式 | 示例 |
|---|
| threshold | 满X减Y | 满300减50 |
| discount |
X折 或 X% off | 8折, 20% off |
| bundle | 买X件享Y价 | 买2件第2件半价 |
| gift | 满X赠品 | 满200赠小样 |
| member_price | 会员专属价 | VIP价¥199 |
步骤3:处理叠加
检查每个促销的 stackable 字段。
- - stackable: true → 可与其他促销叠加
- stackable: false → 使用价值最高的单个促销
- 如有疑问:采用对客户更有利的规则
步骤4:呈现结果
显示原价 → 适用促销 → 最终价格 → 总节省金额。
回答格式
单件商品查询
这款连衣裙 原价:¥399
✨ 夏日大促:满300减50
会员折扣:9折(VIP专享)
最终价格:¥309(节省¥90)
购物车计算
您的购物清单:
白色连衣裙 ×1 ¥399
条纹衬衫 ×1 ¥259
小计:¥658
✨ 满300减50 → -¥50
✨ 满600再减80 → -¥80(两件合计超过600!)
最终合计:¥528(节省¥130 🎉)
无有效促销
目前[产品/全场]暂无特别优惠活动。
当前售价:¥[price]
边界情况
冲突促销: 始终采用对客户最有利的规则。说明采用了哪条规则。
客户提及已过期促销: 这个活动已于[date]结束了,目前[有/没有]新的优惠。
促销不在知识库中但客户声称存在: 我目前没有查到这个活动的信息,建议向店员确认一下,以免信息有误。
会员等级未知: 您的会员等级我暂时查不到,建议核实后,会员专属折扣会自动应用。
脚本
使用 scripts/calculate_promotion.py 进行精确数值计算。
参考: promo-rules-guide.md — 详细规则解析。