@@ -23,17 +23,15 @@ class WC_Connect_TaxJar_Integration {
2323
2424 private $ expected_options = array (
2525 // Users can set either billing or shipping address for tax rates but not shop
26- 'woocommerce_tax_based_on ' => 'shipping ' ,
26+ 'woocommerce_tax_based_on ' => 'shipping ' ,
2727 // Rate calculations assume tax not included
28- 'woocommerce_prices_include_tax ' => 'no ' ,
28+ 'woocommerce_prices_include_tax ' => 'no ' ,
2929 // Use no special handling on shipping taxes, our API handles that
30- 'woocommerce_shipping_tax_class ' => '' ,
31- // API handles rounding precision
32- 'woocommerce_tax_round_at_subtotal ' => 'no ' ,
30+ 'woocommerce_shipping_tax_class ' => '' ,
3331 // Rates are calculated in the cart assuming tax not included
34- 'woocommerce_tax_display_shop ' => 'excl ' ,
32+ 'woocommerce_tax_display_shop ' => 'excl ' ,
3533 // TaxJar returns one total amount, not line item amounts
36- 'woocommerce_tax_display_cart ' => 'excl ' ,
34+ 'woocommerce_tax_display_cart ' => 'excl ' ,
3735 );
3836
3937 /**
@@ -1023,6 +1021,12 @@ public function maybe_apply_taxjar_nexus_addresses_workaround( $body ) {
10231021 'from_country ' => 'US ' ,
10241022 'from_state ' => 'AZ ' ,
10251023 ),
1024+ 'US-OH ' => array (
1025+ 'to_country ' => 'US ' ,
1026+ 'to_state ' => 'OH ' ,
1027+ 'from_country ' => 'US ' ,
1028+ 'from_state ' => 'OH ' ,
1029+ ),
10261030 );
10271031
10281032 foreach ( $ cases as $ case ) {
@@ -1099,7 +1103,7 @@ public function calculate_tax( $options = array() ) {
10991103 // Strict conditions to be met before API call can be conducted.
11001104 if (
11011105 empty ( $ to_country ) ||
1102- empty ( $ to_zip ) ||
1106+ ( empty ( $ to_zip ) && ! in_array ( $ to_country , WC ()-> countries -> get_vat_countries () ) ) ||
11031107 ( empty ( $ line_items ) && ( empty ( $ shipping_amount ) ) ) ||
11041108 WC ()->customer ->is_vat_exempt ()
11051109 ) {
@@ -1441,7 +1445,7 @@ public function smartcalcs_cache_request( $json, $from_state ) {
14411445 $ zip_state_cache_key = strtolower ( 'tj_tax_ ' . $ to_zip . '_ ' . $ to_state );
14421446 $ response = get_transient ( $ zip_state_cache_key );
14431447 }
1444- $ response = $ response ? $ response : get_transient ( $ cache_key );
1448+ $ response = ! empty ( $ response ) ? $ response : get_transient ( $ cache_key );
14451449 if ( $ response && 'CA ' !== $ from_state ) {
14461450 // If $from_state is not California, we need to check for incorrect California tax nexus.
14471451 try {
0 commit comments