diff --git a/inc/functions/tax.php b/inc/functions/tax.php index 1e833d5ac..4a56811e5 100644 --- a/inc/functions/tax.php +++ b/inc/functions/tax.php @@ -201,6 +201,20 @@ function wu_get_applicable_tax_rates($country, $tax_category = 'default', $state } } + /* + * If no country-specific rates matched, apply any rates configured + * with '*' (Apply to all countries) as a fallback. + */ + if (empty($results)) { + foreach ($tax_category['rates'] as $rate) { + if ('*' === $rate['country']) { + $rate['order'] = 1; + + $results[ $rate['id'] ] = $rate; + } + } + } + uasort($results, 'wu_sort_by_order'); return array_values($results); diff --git a/lang/ultimate-multisite.pot b/lang/ultimate-multisite.pot index 088d83443..35fb3b5b7 100644 --- a/lang/ultimate-multisite.pot +++ b/lang/ultimate-multisite.pot @@ -22513,8 +22513,12 @@ msgstr "" msgid "Loading Tax Rates..." msgstr "" -#: views/taxes/list.php:266 -#: views/taxes/list.php:281 +#: views/taxes/list.php:243 +msgid "Apply to all countries" +msgstr "" + +#: views/taxes/list.php:270 +#: views/taxes/list.php:285 msgid "Leave blank to apply to all" msgstr "" diff --git a/views/taxes/list.php b/views/taxes/list.php index d7213bb29..8fcfbc84e 100644 --- a/views/taxes/list.php +++ b/views/taxes/list.php @@ -239,6 +239,10 @@