Commit 0c14697
committed
fix(checkout): use original per-day rates for period-switch detection
Preserve $orig_old_price_per_day / $orig_new_price_per_day before
search_for_same_period_plans() normalises the rates, then compare those
originals in the $is_period_switch_to_shorter check. Previously the
normalised (plan-variation) rates were used, which could mis-classify
a period switch when the normalised rates happened to diverge from the
true membership vs. cart rates.
Also update test_get_billing_next_charge_date_null_membership_guard to
actually exercise the null-membership guard: force cart_type to
'downgrade' via ReflectionProperty so the downgrade branch in
get_billing_next_charge_date() is reached with a null membership, proving
the guard prevents a fatal call to is_active() on null.
Resolves #8921 parent 458bc0c commit 0c14697
2 files changed
Lines changed: 23 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1319 | 1319 | | |
1320 | 1320 | | |
1321 | 1321 | | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
1322 | 1330 | | |
1323 | 1331 | | |
1324 | 1332 | | |
| |||
1357 | 1365 | | |
1358 | 1366 | | |
1359 | 1367 | | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1360 | 1371 | | |
1361 | 1372 | | |
1362 | 1373 | | |
1363 | 1374 | | |
1364 | | - | |
| 1375 | + | |
1365 | 1376 | | |
1366 | 1377 | | |
1367 | 1378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3034 | 3034 | | |
3035 | 3035 | | |
3036 | 3036 | | |
3037 | | - | |
3038 | | - | |
3039 | | - | |
3040 | | - | |
3041 | | - | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
3042 | 3042 | | |
3043 | 3043 | | |
3044 | 3044 | | |
| |||
3047 | 3047 | | |
3048 | 3048 | | |
3049 | 3049 | | |
3050 | | - | |
3051 | | - | |
3052 | | - | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
3053 | 3056 | | |
3054 | 3057 | | |
3055 | 3058 | | |
| |||
0 commit comments