Commit 8e0d31e
committed
Stage 5i: migrate CatalogPricingRule + post-Stage 5 fixes
CatalogPricingRule moves to src/:
- craft\commerce\models\CatalogPricingRule → CraftCms\Commerce\Catalog\Models\CatalogPricingRule
Key swaps:
- craft\base\Model → CraftCms\Cms\Component\Component
- Yii2 defineRules() → Laravel getRules() with Rule::in() for 'apply'
- I18N::getFormatter()->asPercent() / Conditions::createCondition() facades
- CraftCms\Cms\Support\Json::decodeIfJson()
Post-Stage 5 fixes:
- Fix infinite recursion in ShippingMethodOrderCondition,
ShippingRuleOrderCondition, DiscountOrderCondition config() methods.
$this->toArray(['storeId']) was calling getObjectVars() which triggers
the PHP 8.4 $config property hook getter, recursing into config().
Replaced with explicit ['storeId' => $this->storeId].
Also adds CraftCms\Commerce\Base\EnumHelpersTrait (companion to the
Stage 1 enums, missed at the time) and the WIP changelog covering
stages 1–5.
Legacy CatalogPricingRule becomes a class_alias stub.1 parent 6ea808b commit 8e0d31e
7 files changed
Lines changed: 693 additions & 524 deletions
File tree
- src-yii2
- elements/conditions/orders
- models
- src
- Base
- Catalog/Models
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
0 commit comments