Skip to content

[Backport to release/11.2] Fix the Checkout block rejecting 4-digit Argentine postcodes - #69662

Merged
jorgeatorres merged 1 commit into
release/11.2from
cherry-pick-PR69658-to-release/11.2
Oct 9, 2026
Merged

jorgeatorres merged 1 commit into
release/11.2from
cherry-pick-PR69658-to-release/11.2

Conversation

@woocommercebot

Copy link
Copy Markdown
Collaborator

This PR is a cherry-pick of #69658 to release/11.2.

Original PR Description

Submission Review Guidelines:

Changes proposed in this Pull Request:

A shopper in Argentina who types a four-digit postcode such as 1213 in the Checkout block sees "Please enter a valid postcode" and cannot place the order. It happens since 11.2.0, while the Store API accepts the same value.

The Checkout block accepts the legacy four-digit Argentine codes again, as it did in 11.1.

  • Why it happens: Argentina is not in the shared rules file, so the block falls back to the postcode-validator package. Unify postcode validation between PHP and Checkout blocks #67780 bumped it from 3.9.2 to 3.10.22, where the Argentina regex made the province letter mandatory. The server has no rule for Argentina.
  • The fix pins the package back to 3.9.2. The shared rules are unchanged (the regenerated file differs only in its version line), so PHP validation does not move. It also undoes 21 countries that 3.10.22 started validating in the browser only; El Salvador, Saint Vincent and the British Virgin Islands were exposed the same way. Vietnam returns to the 11.1 rule, six digits only.
  • Jest pins the Argentine fallback so the next bump fails CI instead of reaching shoppers. Sharing one rule set with the server is Share one postcode rule set across server and both checkouts #68244.

Closes #69643
Closes WOOPLUG-7949

Bug introduced in PR #67780.

How to test the changes in this Pull Request:

  1. On a store with this branch built and Argentina as a selling location, add a product to the cart and open the Checkout block.
  2. Pick Argentina and Ciudad Autónoma de Buenos Aires, type 1213 in Postcode / ZIP and leave the field. On trunk the field shows "Please enter a valid postcode"; with this PR there is no error and the order goes through.
  3. C1213ABC is accepted on both; 142 still shows the error.

Testing that has already taken place:

  • The new Jest cases fail on 3.10.22 (1213, 7540 rejected) and pass on 3.9.2; the validation and checkout form suites pass (291 tests).
  • Regenerating the rules file on 3.9.2 changes only the generatedFrom.version line. pnpm install --frozen-lockfile passes. ESLint clean.
  • Browser: WordPress Studio, WordPress 7.1.3, PHP 8.4, this branch built, store in Argentina with Cash on delivery and Free shipping. 1213 shows no error, the shipping options load, and the order is placed with postcode 1213 on both addresses. 142 shows "Please enter a valid postcode".
  • No PHP changed; the PHP suites were not run.

Milestone

Note: Check the box above to have the milestone automatically assigned when merged.
Alternatively (e.g. for point releases), manually assign the appropriate milestone.

Changelog entry

  • Automatically create a changelog entry from the details below.

  • This Pull Request does not require a changelog entry. (Comment required below)

Changelog Entry Comment

Comment

Created manually.

Use of AI Tools

I used Claude Code for the investigation and the change, and I reviewed the diff.

@woocommercebot
woocommercebot requested review from a team as code owners October 9, 2026 14:59
@woocommercebot
woocommercebot requested review from jorgeatorres and ralucaStan and removed request for a team October 9, 2026 14:59
@github-actions github-actions Bot added this to the 11.2.0 milestone Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Testing Guidelines

Hi @jorgeatorres @ralucaStan @woocommerce/monorepo,

Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

Reminder: PR reviewers are required to document testing performed. This includes:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

@github-actions github-actions Bot added plugin: woocommerce Issues related to the WooCommerce Core plugin. focus: monorepo infrastructure Issues and PRs related to monorepo tooling. labels Oct 9, 2026
@jorgeatorres
jorgeatorres merged commit 4361065 into release/11.2 Oct 9, 2026
60 of 63 checks passed
@jorgeatorres
jorgeatorres deleted the cherry-pick-PR69658-to-release/11.2 branch October 9, 2026 15:01
@github-actions github-actions Bot added the metric: feature freeze exception A tracking label for PRs that were merged after the feature freeze. label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a commit that changes plugin code.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Size Change: 0 B 🆕

Total Size: 0 B

compressed-size-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

focus: monorepo infrastructure Issues and PRs related to monorepo tooling. metric: feature freeze exception A tracking label for PRs that were merged after the feature freeze. plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Sponsor
SponsoredKunjungi sekarang
Promo