Closed csmcneill closed 1 year ago
Note: We've so far only seen this issue on AT sites. It might affect self-hosted sites, but that is still TBD.
There are a few options as a temporary workaround, including:
[woocommerce_checkout]
shortcode instead of the checkout block.These options are listed in order from least to most invasive.
I can consistently replicate this with some minor tweaks to @csmcneill's steps. The key is to place an order with one State/ZIP, then try and place another order with a different State/ZIP
Como, Mississippi, US 38619
Sacramento, California, US 95816
What's strange is, as Chris mentioned, the request/response has the correct info
Clearing the woocommerce_cart_hash
, woocommerce_items_in_cart
, and the wp_woocommerce_session_
cookies fixes this until another order is placed with 1 State/ZIP and a different combo is used within the same session. Which makes me wonder if this is caused by the same cookie conflict between WCPay and Jetpack Sync: https://github.com/Automattic/woocommerce-payments/issues/5491
(Jetpack team is working on a fix here: https://github.com/Automattic/jetpack/pull/31423)
I've disabled Dedicated Sync on my JN site, but the issue still occurs. In the workaround mentioned, it can take some time to take effect, so I'll check again tomorrow: p1687117159732829-slack-CB37YNEH1
Edit: Disabling Dedicated Sync did not fix this issue.
Hi, thanks for the report.
I can tell you for certain, the validation error you're reporting is not coming from blocks—the error code/text does not match anything in either blocks or Store API.
There is also no validation "against states". We only check the format against country codes, and the resulting error code is The provided postcode / ZIP is not valid
.
I did however find the error code you reported in the TaxJar integration of WooCommerce Shipping & Tax (WooCommerce Services).
@ralucaStan should we move this issue to there or track here?
Thanks for the context. Despite the error coming from WCS&T, I think the reasoning for opening this here was because it only seems to happen with the Checkout block, and not the shortcode.
There's another mention of this issue in the WordPress Support forum: https://wordpress.org/support/topic/disable-zipcode-validation/.
@ralucaStan, heads-up there's another thread on WordPress Support forum that seems like the same issue: https://wordpress.org/support/topic/checkout-error-zip-code-does-not-match-selected-state/
Thank you @kmanijak. I asked for some testing steps. We haven't been able to replicate this so far
Hi @kmanijak and @ralucaStan, thank you both for looking into this and replying to those forum threads! I believe this will be fixed in WCS&T with https://github.com/Automattic/woocommerce-services/issues/2683. More context here: p1695137216084799/1694506091.052629-slack-C04KWSNPSE5
Since this seems to be an issue on the WCS&T side, I'm unsure if we should close this issue now or leave it open until we've confirmed it's fixed.
7075851-zen
I think it's safe to close this ticket as there is nothing actionable on our side, the solution will come from https://github.com/Automattic/woocommerce-services/issues/2683.
Thank you so much for the update and happy to see progress is being made on this one
7127464-zen
Describe the bug
When using the checkout block or a block based theme like Blockbase or Tsubaki while WooCommerce Shipping & Tax (WCS&T) is active, using a valid combination of state + ZIP will occasionally produce the following error for customers:
There are no errors logged in WCS&T that indicate there is an invalid state and ZIP combination in use, which suggests that the issue is not stemming from WCS&T.
Disabling WCS&T, Jetpack (which is used to power WCS&T), or moving away from a block-based checkout will resolve this error.
This seems to be stemming from a
409
error associated withcheckout?_locale=user
. Here is a snippet from the payload:Note that
38619
is a postcode used for Como, Mississippi, USA.There is also a 409 error in the console:
There are several references to
checkout-frontend.js
, which seems to be related to/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/checkout-frontend.js
.To reproduce
Steps to reproduce the behavior:
Note for step 6: this may require using a guest checkout, clearing the browser cache, and/or attempting multiple different postcode/state combinations, as it's finicky if a postcode is used that's been validated before. Here are some that I use that can help with debugging:
Expected behavior
The checkout block will not throw ZIP code validation errors for customers when they enter a valid postcode and state combination.
Screenshots
Environment
WordPress (please complete the following information):
Desktop (please complete the following information):
Additional context
6761785-zen 6662493-zen p1692249095376639-slack-C028SDRAAJF p1689055060770119-slack-C028SDRAAJF p1692225907962829-slack-C015MKUHB2M