mcpField
V
volume-pricing

volume-pricing

github.com/finsilabs营销与增长6080 次安装5 天前更新
代码仓库

关于 volume-pricing

面向电商团队的阶梯定价实施技能,介绍多个平台的配置方法及无头店面的自定义定价逻辑,适用于 B2B 批量销售和提升客单价。

主要功能

  1. 01按购买数量设置阶梯单价
  2. 02按客户群体配置价格
  3. 03在商品页展示价格阶梯
  4. 04购物车数量变化时重算价格
  5. 05涵盖主流电商平台与自定义实现

适用场景

  1. 01为批发客户设置数量折扣
  2. 02同时管理零售与 B2B 价格
  3. 03提示消费者增加购买量以获得优惠
  4. 04在无头店面实现自定义批量定价

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill volume-pricing

安装后在 Claude Code 中输入/volume-pricing确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

tile.json
evals/price-resolution-and-tier-priority-logic/
criteria.json
task.md
evals/pricing-table-display-and-cart-totals/
criteria.json
task.md
evals/volume-pricing-schema-design/
criteria.json
task.md

详细介绍

批量定价

概述

批量定价(也称数量阶梯定价或分级定价)会随着订购数量增加而自动降低单价。这是 B2B 和批发渠道的一项核心功能,也能有效提升消费类商店的平均订单金额(例如“再购买 3 件即可享受 10% 折扣”)。大多数平台都不原生支持批量定价;你需要使用应用或插件。本技能将介绍各平台的设置方法,并涵盖无头店面的自定义实现。

何时使用此技能

  • 向 B2B 买家销售时,他们期望大额订单能享受单件价格折扣
  • 在零售渠道之外运营批发渠道,且两者采用不同定价
  • 希望通过向客户展示多买能省多少钱来提高平均订单金额
  • 管理多个客户群体(零售、批发、分销商),并为其设置不同的价目表
  • 为定制批量订单构建配置-定价-报价(CPQ)流程

核心说明

第 1 步:确定商家的平台并选择合适的工具
平台推荐工具原因
ShopifyWholesale Club 或 Quantity Breaks & Discounts by FORSBERGWholesale Club 可添加具备客户群组定价功能的完整 B2B 渠道;Quantity Breaks 则为 B2C 提供分级定价,并在商品页面显示价格表
Shopify PlusShopify B2B(内置)Shopify Plus 包含原生 B2B 功能,包括公司账户、价目表和最低订购数量
WooCommerceWooCommerce Dynamic Pricing 扩展(约 $99/年)或 YITH WooCommerce Dynamic Pricing & Discounts(约 $70/年)两款插件均支持基于数量的阶梯定价、按客户角色设定价格,以及商品页面价格表
BigCommercePrice Lists(原生,适用于 Plus 套餐及更高版本)BigCommerce 的 Price Lists 功能专为 B2B 批量定价设计,可将价目表分配给客户群组
自定义 / 无头构建调用平台定价 API 的阶梯解析逻辑可完全掌控阶梯定义和购物车重新计算
第 2 步:在平台上设置批量定价

Shopify(非 Plus)

选项 A:Quantity Breaks & Discounts 应用(面向 B2C)

  1. 从 Shopify App Store 安装 Quantity Breaks & Discounts(由 FORSBERG+two 开发)(免费套餐;付费套餐约 $10/月)
  2. 在应用中,前往 Discount Groups → Create
  3. 选择要应用阶梯定价的商品或商品系列
  4. 添加数量阶梯:
    • 阶梯 1:数量 1+,折扣 0%(原价)
    • 阶梯 2:数量 5+,折扣 10%
    • 阶梯 3:数量 10+,折扣 20%
    • 阶梯 4:数量 25+,折扣 30%
  5. 应用会自动在商品页面显示价格表,并在客户更新购物车数量时应用相应折扣

选项 B:Wholesale Club(面向 B2B)

  1. 从 Shopify App Store 安装 Wholesale Club(约 $30/月)
  2. 创建批发客户群组(应用会创建基于标签的系统)
  3. 设置批发价格:按商品或商品系列设置固定价格或百分比折扣
  4. 为批发客户添加批发标签,授予其访问权限
  5. 批发客户会在商品页面和结账时看到阶梯价格

Shopify Plus — 原生 B2B

Shopify Plus 提供原生 B2B 渠道,无需使用批发应用:

  1. 前往 Sales channels → B2B
  2. 为每位 B2B 客户创建一个 Company
  3. 在公司下创建一个 Location,并分配一个 Price list
  4. 在价目表中设置各商品的价格(固定价格或百分比调整)
  5. 设置 Payment terms(net 30、net 60 等)和 Order minimums
  6. 公司联系人通过商店的 B2B 门户登录后,会自动看到分配给他们的价格

WooCommerce

使用 WooCommerce Dynamic Pricing:

  1. 从 WooCommerce.com 安装 WooCommerce Dynamic Pricing,或安装 YITH WooCommerce Dynamic Pricing & Discounts
  2. 前往 WooCommerce → Dynamic Pricing → Add Rule
  3. 设置:
    • Rule type:Product Pricing 或 Category Pricing
    • Apply to:指定产品、分类或所有产品
    • Pricing type:百分比折扣或固定价格覆盖
  4. 添加数量阶梯:
    最低数量最高数量折扣
    140%
    5910%
    102420%
    25—30%
  5. 可选:按 User role 限制仅适用于 B2B/批发阶梯
  6. 购物车数量变化时,插件会自动重新计算价格

在产品页面显示价格表: 两款 Dynamic Pricing 插件都包含价格表小工具,可直接在产品页面显示数量折扣阶梯。可在插件设置中配置其外观。


BigCommerce

BigCommerce 的 Price Lists 功能可在 Plus 及更高套餐中原生处理批量定价。

设置带数量阶梯的价格表:

  1. 前往 Products → Price Lists → Create Price List
  2. 为列表命名(例如“批发 2026”),并将其分配给一个 Customer Group
  3. 添加产品并设置价格:
    • 对于每个产品,都可以设置基础价格覆盖
    • 要设置数量折扣,请使用每个产品中的 Bulk Pricing 区域
  4. 前往某个产品 → Pricing 标签页 → Bulk Pricing:
    • 添加阶梯:例如,5 件以上 = 每件 $X,10 件以上 = 每件 $Y
    • 设置批量价格是适用于所有客户,还是适用于特定价格表
  5. 在 Customers → Customer Groups 下,将价格表分配给客户组

自定义/无头架构

对于无头店面,请在定价服务中实现阶梯解析:

interface PriceTier {
  minQuantity: number;
  maxQuantity?: number;       // undefined = no upper limit
  type: 'fixed' | 'percentage_off';
  value: number;              // cents if fixed; percentage (0-100) if percentage_off
  customerGroup?: string;     // null = all customers
}

async function resolveUnitPrice(
  productId: string,
  quantity: number,
  customerGroup: string | null,
  basePrice: number   // cents
): Promise<{ unitPriceCents: number; savingsPct: number }> {
  // 1. Check for customer-group-specific price list (highest priority)
  if (customerGroup) {
    const priceListItem = await db.priceLists
      .findActive({ product_id: productId, customer_group: customerGroup, min_quantity: { lte: quantity } })
      .orderBy('min_quantity', 'desc')
      .first();
    if (priceListItem) {
      const savingsPct = Math.round((1 - priceListItem.price / basePrice) * 100);
      return { unitPriceCents: priceListItem.price, savingsPct };
    }
  }

  // 2. Find the best matching general volume tier
  const tiers = await db.priceTiers.find({
    product_id: productId,
    customer_group: customerGroup ?? null,
  });

  const applicable = tiers.filter(t =>
    quantity >= t.minQuantity && (t.maxQuantity === undefined || quantity <= t.maxQuantity)
  ).sort((a, b) => b.minQuantity - a.minQuantity); // highest-qualifying tier first

  const tier = applicable[0];
  if (!tier) return { unitPriceCents: basePrice, savingsPct: 0 };

  const unitPriceCents = tier.type === 'fixed'
    ? tier.value
    : Math.round(basePrice * (1 - tier.value / 100));
  const savingsPct = Math.round((1 - unitPriceCents / basePrice) * 100);

  return { unitPriceCents, savingsPct };
}

每次数量变化时重新计算:

async function updateCartLinePricing(cartId: string, lineId: string, newQuantity: number) {
  const line = await db.cartLines.findById(lineId);
  const { unitPriceCents } = await resolveUnitPrice(
    line.productId, newQuantity, line.customerGroup, line.basePriceCents
  );
  await db.cartLines.update(lineId, {
    quantity: newQuantity,
    unitPriceCents,
    lineTotalCents: unitPriceCents * newQuantity,
  });
}

在产品页面显示价格表:

查询阶梯断点并显示表格:

async function getPricingTable(productId: string, customerGroup: string | null, basePrice: number) {
  const breakpoints = [1, 5, 10, 25, 50, 100];
  const rows = await Promise.all(breakpoints.map(async qty => {
    const { unitPriceCents, savingsPct } = await resolveUnitPrice(productId, qty, customerGroup, basePrice);
    return { quantity: qty, unitPriceCents, savingsPct };
  }));
  // Only show rows where the price actually changes
  return rows.filter((row, i) => i === 0 || row.unitPriceCents !== rows[i - 1].unitPriceCents);
}

最佳实践

  • 在产品页面显示价格表 — 展示后续阶梯(“再添加 3 件即可享受 10% 折扣”)已被证明能提升 AOV;不要隐藏此信息
  • 购物车数量变化时重新计算价格 — 确保购物车中的单价实时更新,而不只是结账时更新
  • 将价格表与阶梯逻辑分开 — B2B 价格表覆盖应优先于批量折扣阶梯;按清晰的优先级顺序解析
  • 为批发阶梯设置最低订购量 — 如果批发价格表要求最低订购量,应在结账时强制执行,而不只是显示在 UI 中
  • 在结账时验证最低数量 — 某些 B2B 配置要求最低数量;应在服务器端强制执行,以防订单绕过 UI 限制
  • 醒目地显示节省金额 —“您已节省 $18.00(30%)”比只显示折后价格更有吸引力

常见问题

问题解决方案
购物车数量变化,但价格没有更新每次购物车数量变化时,实时重新计算所有商品行价格,而不只是结账时重新计算
B2B 买家在订单确认邮件中看到零售价在所有价格解析调用中传递 customerGroup,包括渲染订单确认邮件时
属于两个组的客户看到的价格不一致按明确的优先级解析:价格表 > 产品阶梯 > 分类阶梯 > 基础价格
更新后价格表仍显示过时的阶梯修改阶梯时清除定价缓存;按产品或阶梯版本使缓存失效
搜索结果页面未显示阶梯价格对已登录的 B2B 客户,搜索/集合页面上的产品卡片也应在服务器端解析价格

相关技能

  • @b2b-commerce
  • @price-rules-engine
  • @discount-engine
  • @coupon-management
  • @multi-channel-selling

评论

支持 Markdown