Skip to content

[Shopify] Remove B2B Plus-only plan restriction#7605

Open
onbuyuka wants to merge 8 commits intomainfrom
bugs/630316-remove-b2b-plus-restriction
Open

[Shopify] Remove B2B Plus-only plan restriction#7605
onbuyuka wants to merge 8 commits intomainfrom
bugs/630316-remove-b2b-plus-restriction

Conversation

@onbuyuka
Copy link
Copy Markdown
Contributor

@onbuyuka onbuyuka commented Apr 8, 2026

Summary

Shopify expanded B2B features 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

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

Shopify expanded B2B features (companies, catalogs, orders) to all plans,
not just Plus. Remove the plan-based gating on B2B features and obsolete
the "B2B Enabled" field. Staff member queries still require Plus, Plus
Trial, Development, or Advanced plans, so introduce a new "Staff Members
Enabled" field (207) with the appropriate plan check.

Fixes AB#630316

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@onbuyuka onbuyuka requested a review from a team as a code owner April 8, 2026 13:37
@github-actions github-actions bot added the AL: Apps (W1) Add-on apps for W1 label Apr 8, 2026
Add missing Shop Code filter when checking for existing company by
External Id during export, preventing cross-shop false positives.

Fixes AB#630316

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added this to the Version 29.0 milestone Apr 8, 2026
@onbuyuka onbuyuka marked this pull request as draft April 8, 2026 13:38
onbuyuka and others added 2 commits April 8, 2026 15:42
Rename "Staff Members Enabled" to "Has Advanced Shopify Plan" so the
field can gate any plan-dependent features, not just staff members.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AL Documentation Audit

Documentation gaps were detected in the following apps:

  • Shopify-Connector-Test: 67% documentation coverage

To generate documentation, run /al-docs init or /al-docs update using GitHub Copilot CLI or Claude Code.
This review is for awareness to help keep documentation in sync with code changes. It is okay to dismiss this request.

Refresh docs across 15 files to reflect B2B Enabled obsolescence,
Advanced Shopify Plan field, contact lookup, UoM price validation,
HttpClientHandler migration, and other changes since 2026-03-24.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@onbuyuka onbuyuka marked this pull request as ready for review April 9, 2026 11:18
@onbuyuka onbuyuka enabled auto-merge (squash) April 9, 2026 11:18
onbuyuka and others added 3 commits April 10, 2026 12:25
B2B catalog creation remains a Plus/Advanced feature. Hide the B2B
Catalogs action and skip CatalogPricesSync for shops on lower plans.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No B2B catalogs exist on basic plans, so the sync iterates zero records.
No need to gate the call.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant