taxjar / taxjar-magento2-extension

Magento 2 Sales Tax Extension by TaxJar
http://www.taxjar.com/guides/integrations/magento2/
Open Software License 3.0
22 stars 30 forks source link

Can not validate address postal code when postcode validation rules are disabled #302

Closed serzhik closed 2 years ago

serzhik commented 2 years ago

Context

Customer reported issue that postcode is not valid when all rules in zip_codes.xml are disabled for country.

Description

When all rules for postcodes are disabled TaxJar show message in order calculation section: SKIPPED - Could not validate address postal code. This error is caused because the module expects the country has at least one rule for the postcode. When all rules for the country are disabled it can not validate postcode.

Performance

Bug fix

Testing

Versions

[x] Magento 2.4 [ ] Magento 2.3

[x] Magento Open Source (CE) [x] Magento Commerce (EE) [ ] Magento B2B [ ] Magento Cloud

[x] PHP 7.x

sethobey commented 2 years ago

Hi @serzhik, if you would like to allow any zip code format in the US, is it maybe possible to only include a rule like:

<code id="pattern_any" active="true" example="Any text">.*</code>

instead of removing all rules? I haven't tested this solution, but this code has been unchanged for a number of years.

sethobey commented 2 years ago

Hi @serzhik, please do follow up so we can better understand this use case if the solution above does not work for you.