Automattic / woocommerce-services

WooCommerce Services is a feature plugin that integrates hosted services into WooCommerce (3.0+), and currently includes automated tax rates and the ability to purchase and print USPS shipping labels.
GNU General Public License v2.0
107 stars 20 forks source link

Tax Rates fail for UK addresses when adding counties #1600

Closed RiaanKnoetze closed 4 years ago

RiaanKnoetze commented 5 years ago

Reported in:

1942485-zen 14189124-hc 2524915-zen 2537618-zen

Summary

For all addresses in the UK, the tax rate on the front end will display as 0.00 if a county is entered that actually exists.

Steps to replicate

  1. Install/Activate/Connect Jetpack
  2. Install/Activate WooCommerce Services
  3. Set your store address to have a UK address (e.g. 63 Elford Crescent, Plympton, Plymouth, UK, PL74BT)
  4. Set your tax rate settings to "Enable Automated Taxes"
  5. On the front end, add a product to the cart and proceed to checkout
  6. On the billing address section, use any of the following address:
    • 2 Chestnut Hall Avenue, Maghaberry, Moira, County Armagh, BT67 0GG
    • 40 Whitehall Way, Rockingham, Rotherham, South yorkshire, S61 4HW
    • 19 Carisbrooke Close, EASTBOURNE, East Sussex, BN23 8EQ
  7. Notice on the checkout page that VAT is showing up as 0.00
  8. Complete the order.
  9. Notice that the postcode for that order has been added as a tax rate under WooCommerce > Settings > Tax > Standard Rates

Here's are some screenshots to illustrate that better:

Front-end Checkout

https://cld.wthms.co/4Jes3J Full Image: https://cld.wthms.co/4Jes3J+

Tax Settings after checkout

https://cld.wthms.co/p9KLqN Full Image: https://cld.wthms.co/p9KLqN+

Additional Notes

@mikkamp managed to narrow things down even further to the county field. When using "Bogus" as the county, tax rates work as expected. When a legitimate county is used (e.g. "County Armagh"), tax rates are borked and multiple entries are created in the standard rates section.

harriswong commented 4 years ago

This will be in your webserver, assuming wordpress is the directory for your WordPress installation, then the path would be at wordpress/wp-content/plugins/woocommerce-services/classes/class-wc-connect-taxjar-integration.php