fix(frontend): route the VIP points-exchange entry through the custom currency name

/user/vip/ 档位购买卡下方的入口横条仍硬编码「积分兑换会员」,而后台
「积分配置 → 自定义货币名称」改名后不跟随。上一轮改名只覆盖了兑换弹窗
标题与会员弹窗内入口,页面自身的入口横条是另一处服务端渲染,漏改了。

入口横条(inc/helpers/aksrt-vip.php)
- aksrt_get_vip_points_exchange_entry_html 改取已加载的
  catalog.currency_name,回退 Settings::get_currency_name() 再回退「积分」

同一页面上其余漏改的兑换文案一并收口,命名与入口/弹窗保持一致:
- VipServiceModal:积分不足提示 → {货币名}不足,暂时无法兑换
- VipServicePurchase.exchange_with_points:兑换未启用 / 兑换无效 /
  不足三处 WP_Error、流水说明、订单备注(%1$s兑换会员 %2$d %1$s。)
  currency_name 在此单独解析,get_catalog 内的局部变量不在该作用域
- LedgerPresentation:vip_points_exchange 流水原因标签

契约测试新增源断言,并用两个 PHP harness 做运行时断言:入口横条
(改名后 / 已是会员不输出 / 缺 key 回退)与弹窗(余额充足 / 不足两分支)。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-01 16:19:49 +08:00
1 parent 4e62b325d2
commit 5b16bc6e15
7 files changed
+177 -11

No files matched your search

@@ -51,11 +51,15 @@ namespace {
'unit' => 'day',
]],
],
'user_points' => 1000,
'currency_name' => '积分',
// 可用 argv 覆盖余额,用于覆盖「不足」分支(套餐价 500)。
'user_points' => isset($GLOBALS['aksrt_probe_points']) ? (int) $GLOBALS['aksrt_probe_points'] : 1000,
// 自定义货币名(后台「积分配置 → 自定义货币名称」):标题/我的X/
// 不足提示都跟随它,不硬编码「积分」。
'currency_name' => '书币',
];
}
}
$GLOBALS['aksrt_probe_points'] = isset($argv[1]) ? (int) $argv[1] : 1000;
echo (new VipPointsDescriptionProbe())->get_points_exchange_modal_html(1);
}