Commit 3227a35
[Shopify] Remove B2B Plus-only plan restriction (#7605)
## Summary
Shopify [expanded B2B
features](https://changelog.shopify.com/posts/key-b2b-features-now-available-on-non-plus-plans)
to all plans (Basic, Grow, Advanced, Plus), not just Plus. The connector
currently restricts B2B to Plus plans only via the `B2B Enabled` field
on the Shop table.
This PR:
- **Obsoletes the `B2B Enabled` field** (117) with
`CLEAN29`/`CLEANSCHEMA32` guards — B2B features (companies, catalogs,
company sync, B2B orders) are now unconditionally available on all plans
- **Introduces `Staff Members Enabled` field** (207) — staff member
GraphQL queries still require Plus, Plus Trial, Development, or Advanced
plans, so this new field gates only staff-member-specific functionality
- **Adds upgrade code** using `DataTransfer` to migrate existing `B2B
Enabled = true` shops to `Staff Members Enabled = true`
- **Removes all consumer code** that checked `B2B Enabled` for B2B
features (ShopCard page visibility, Activities page filter,
ImportOrder/StaffMemberAPI guards)
- **Updates tests** to remove `B2B Enabled` assignments and update staff
visibility test
Fixes
[AB#630316](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/630316)
## Changes by file
| File | Change |
|------|--------|
| `ShpfyShop.Table.al` | Obsolete field 117, add field 207, update
`GetShopSettings()` plan check (adds `Advanced`) |
| `ShpfyShopCard.Page.al` | Remove 6x `Visible = Rec."B2B Enabled"`,
unconditional company/catalog sync, gate StaffMembers on new field |
| `ShpfyActivities.Page.al` | Remove `B2BEnabled` variable and B2B shop
filter |
| `ShpfyImportOrder.Codeunit.al` | Gate `StaffMember` query parameter on
`Staff Members Enabled` instead of `B2B Enabled` |
| `ShpfyStaffMemberAPI.Codeunit.al` | Gate early exit on `Staff Members
Enabled` instead of `B2B Enabled` |
| `ShpfyUpgradeMgt.Codeunit.al` | Add `StaffMembersEnabledUpgrade()`
with `DataTransfer` (source filter + constant value) |
| 4 test files | Remove `B2B Enabled := true` setup, update staff
visibility test |
## How to review
1. **ShpfyShop.Table.al** — verify the obsolete field follows the
`CLEAN29`/`CLEANSCHEMA32` dual-state pattern (compare with field 206).
Verify `GetShopSettings()` now sets `Staff Members Enabled` for Plus,
Plus Trial, Development, and Advanced plans.
2. **ShpfyShopCard.Page.al** — verify all B2B visibility gates are
removed (companies, catalogs, market catalogs, sync companies, B2B
company sync group). Verify `StaffMembers` action is now gated on the
new `Staff Members Enabled` field. Verify the "Sync All" action now
always syncs companies and catalog prices.
3. **ShpfyUpgradeMgt.Codeunit.al** — verify upgrade uses
`AddSourceFilter` on `B2B Enabled = true` + `AddConstantValue(true)` to
`Staff Members Enabled`. Verify tag is registered in
`RegisterPerCompanyTags`.
4. **ShpfyImportOrder.Codeunit.al** /
**ShpfyStaffMemberAPI.Codeunit.al** — verify staff member gating now
uses `Staff Members Enabled` instead of `B2B Enabled`.
5. **Test files** — verify `B2B Enabled` assignments are removed and
staff test uses `Staff Members Enabled`.
## Testing scenarios
- Connect a Basic/Grow plan shop → B2B sections (companies, catalogs)
should be visible and functional
- Connect a Plus/Advanced plan shop → Staff Members action should be
visible, staff member import should work
- Connect a Basic plan shop → Staff Members action should NOT be visible
- Upgrade from previous version → shops that had `B2B Enabled = true`
should now have `Staff Members Enabled = true`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent cb275ec commit 3227a35
28 files changed
Lines changed: 210 additions & 53 deletions
File tree
- src/Apps/W1/Shopify
- App
- docs
- src
- Base
- Codeunits
- Pages
- Tables
- docs
- Companies
- Codeunits
- docs
- Order Fulfillments/docs
- Order Refunds/docs
- Order handling
- Codeunits
- docs
- Products/docs
- Staff/Codeunits
- Transactions/docs
- Test
- Companies
- docs
- Staff
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
59 | | - | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
| |||
136 | 144 | | |
137 | 145 | | |
138 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
134 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
135 | 141 | | |
136 | 142 | | |
137 | 143 | | |
138 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
139 | 147 | | |
140 | 148 | | |
141 | 149 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
514 | 515 | | |
515 | 516 | | |
516 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
517 | 536 | | |
518 | 537 | | |
519 | 538 | | |
| |||
589 | 608 | | |
590 | 609 | | |
591 | 610 | | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
592 | 616 | | |
593 | 617 | | |
594 | 618 | | |
| |||
608 | 632 | | |
609 | 633 | | |
610 | 634 | | |
| 635 | + | |
611 | 636 | | |
612 | 637 | | |
Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
154 | 153 | | |
155 | 154 | | |
156 | 155 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | 156 | | |
162 | 157 | | |
163 | 158 | | |
| |||
166 | 161 | | |
167 | 162 | | |
168 | 163 | | |
169 | | - | |
170 | | - | |
171 | 164 | | |
Lines changed: 5 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
356 | 355 | | |
357 | 356 | | |
358 | 357 | | |
| |||
389 | 388 | | |
390 | 389 | | |
391 | 390 | | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| |||
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
748 | | - | |
749 | 748 | | |
750 | 749 | | |
751 | 750 | | |
| |||
759 | 758 | | |
760 | 759 | | |
761 | 760 | | |
762 | | - | |
| 761 | + | |
763 | 762 | | |
764 | 763 | | |
765 | 764 | | |
| |||
773 | 772 | | |
774 | 773 | | |
775 | 774 | | |
776 | | - | |
777 | 775 | | |
778 | 776 | | |
779 | 777 | | |
| |||
839 | 837 | | |
840 | 838 | | |
841 | 839 | | |
842 | | - | |
| 840 | + | |
843 | 841 | | |
844 | 842 | | |
845 | 843 | | |
| |||
1009 | 1007 | | |
1010 | 1008 | | |
1011 | 1009 | | |
1012 | | - | |
1013 | 1010 | | |
1014 | 1011 | | |
1015 | 1012 | | |
| |||
1126 | 1123 | | |
1127 | 1124 | | |
1128 | 1125 | | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
| 1126 | + | |
| 1127 | + | |
1133 | 1128 | | |
1134 | 1129 | | |
1135 | 1130 | | |
| |||
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
| 720 | + | |
720 | 721 | | |
721 | 722 | | |
722 | 723 | | |
723 | 724 | | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
724 | 733 | | |
| 734 | + | |
725 | 735 | | |
726 | 736 | | |
727 | 737 | | |
| |||
928 | 938 | | |
929 | 939 | | |
930 | 940 | | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
931 | 946 | | |
932 | 947 | | |
933 | 948 | | |
| |||
1114 | 1129 | | |
1115 | 1130 | | |
1116 | 1131 | | |
1117 | | - | |
1118 | | - | |
| 1132 | + | |
| 1133 | + | |
1119 | 1134 | | |
1120 | 1135 | | |
1121 | 1136 | | |
| |||
0 commit comments