Skip to content

Fix region code mismatch in Channable order import#274

Merged
Marvin-Magmodules merged 2 commits into
masterfrom
fix/region-code-mismatch
May 13, 2026
Merged

Fix region code mismatch in Channable order import#274
Marvin-Magmodules merged 2 commits into
masterfrom
fix/region-code-mismatch

Conversation

@Marvin-Magmodules
Copy link
Copy Markdown
Member

@Marvin-Magmodules Marvin-Magmodules commented May 7, 2026

Summary

  • Multi-strategy region lookup: try code, prefixed code (CC-code), then state name fallback, returning null when no match is found
  • Add SkipRegionValidation plugin to suppress regionId validation errors during Channable imports (scoped via CheckoutSession flag)
  • Add E2E tests for LV (pycountry code) and PL (no region) orders

Channable sends state_code values (e.g. "099" for LV) that don't exist in Magento's directory_country_region table, causing "regionId is required" errors when the country is in the "State is Required for" config.

Test plan

  • E2E: LV order with pycountry region code (state_required=LV) — passes
  • E2E: PL order without region — passes
  • Full order-import suite — 14/14 passed, no regressions

Channable sends state_code values (e.g. "099" for LV) that don't exist
in Magento's directory_country_region table, causing "regionId is required"
errors when the country is in the "State is Required for" config.

- Multi-strategy region lookup: try code, prefixed code (CC-code), then
  state name fallback, returning null when no match is found
- Set region_id and region separately on address data
- Add SkipRegionValidation plugin to suppress regionId validation errors
  during Channable imports (scoped via CheckoutSession flag)
- Add E2E tests for LV (pycountry code) and PL (no region) orders

Fixes: channable/magento-plugin#19
@Marvin-Magmodules Marvin-Magmodules merged commit f0b43af into master May 13, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant