diff --git a/changelog.txt b/changelog.txt index 828fe60bb..c7294e871 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,9 @@ *** WooCommerce Tax Changelog *** = 3.2.2 - 2025-xx-xx = +* Add - Allow round tax at subtotal level, instead of rounding per line. +* Add - Allow calculating taxes for VAT countries without providing ZIP. +* Fix - Taxes were incorrectly calculated using the store’s base address for Ohio. * Fix - Display TaxJar error notices only after taxes are calculated. * Tweak - Log detection of potential incorrect California tax nexus in successful TaxJar API and cached responses. diff --git a/classes/class-wc-connect-taxjar-integration.php b/classes/class-wc-connect-taxjar-integration.php index c723c48b9..e2178effc 100644 --- a/classes/class-wc-connect-taxjar-integration.php +++ b/classes/class-wc-connect-taxjar-integration.php @@ -23,17 +23,15 @@ class WC_Connect_TaxJar_Integration { private $expected_options = array( // Users can set either billing or shipping address for tax rates but not shop - 'woocommerce_tax_based_on' => 'shipping', + 'woocommerce_tax_based_on' => 'shipping', // Rate calculations assume tax not included - 'woocommerce_prices_include_tax' => 'no', + 'woocommerce_prices_include_tax' => 'no', // Use no special handling on shipping taxes, our API handles that - 'woocommerce_shipping_tax_class' => '', - // API handles rounding precision - 'woocommerce_tax_round_at_subtotal' => 'no', + 'woocommerce_shipping_tax_class' => '', // Rates are calculated in the cart assuming tax not included - 'woocommerce_tax_display_shop' => 'excl', + 'woocommerce_tax_display_shop' => 'excl', // TaxJar returns one total amount, not line item amounts - 'woocommerce_tax_display_cart' => 'excl', + 'woocommerce_tax_display_cart' => 'excl', ); /** @@ -1023,6 +1021,12 @@ public function maybe_apply_taxjar_nexus_addresses_workaround( $body ) { 'from_country' => 'US', 'from_state' => 'AZ', ), + 'US-OH' => array( + 'to_country' => 'US', + 'to_state' => 'OH', + 'from_country' => 'US', + 'from_state' => 'OH', + ), ); foreach ( $cases as $case ) { @@ -1099,7 +1103,7 @@ public function calculate_tax( $options = array() ) { // Strict conditions to be met before API call can be conducted. if ( empty( $to_country ) || - empty( $to_zip ) || + ( empty( $to_zip ) && ! in_array( $to_country, WC()->countries->get_vat_countries() ) ) || ( empty( $line_items ) && ( empty( $shipping_amount ) ) ) || WC()->customer->is_vat_exempt() ) { @@ -1441,7 +1445,7 @@ public function smartcalcs_cache_request( $json, $from_state ) { $zip_state_cache_key = strtolower( 'tj_tax_' . $to_zip . '_' . $to_state ); $response = get_transient( $zip_state_cache_key ); } - $response = $response ? $response : get_transient( $cache_key ); + $response = ! empty( $response ) ? $response : get_transient( $cache_key ); if ( $response && 'CA' !== $from_state ) { // If $from_state is not California, we need to check for incorrect California tax nexus. try { diff --git a/readme.txt b/readme.txt index eccc45a4b..6aa7b32cf 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,9 @@ This plugin relies on the following external services: == Changelog == = 3.2.2 - 2025-xx-xx = +* Add - Allow round tax at subtotal level, instead of rounding per line. +* Add - Allow calculating taxes for VAT countries without providing ZIP. +* Fix - Taxes were incorrectly calculated using the store’s base address for Ohio. * Fix - Display TaxJar error notices only after taxes are calculated. * Tweak - Log detection of potential incorrect California tax nexus in successful TaxJar API and cached responses.