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/inc/tax/class-tax.php b/inc/tax/class-tax.php index 90eaf4ab4..5f48052c0 100644 --- a/inc/tax/class-tax.php +++ b/inc/tax/class-tax.php @@ -132,6 +132,7 @@ public function add_settings(): void { ], ] ); + } /** diff --git a/lang/ultimate-multisite.pot b/lang/ultimate-multisite.pot index 467e8cc84..ea1e4a489 100644 --- a/lang/ultimate-multisite.pot +++ b/lang/ultimate-multisite.pot @@ -9,7 +9,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2025-11-21T19:45:32+00:00\n" +"POT-Creation-Date: 2025-11-30T09:27:56+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.12.0\n" "X-Domain: ultimate-multisite\n" @@ -3631,7 +3631,7 @@ msgid "Tax description. This is shown on invoices to end customers." msgstr "" #: inc/admin-pages/class-payment-edit-admin-page.php:802 -#: inc/tax/class-tax.php:204 +#: inc/tax/class-tax.php:273 msgid "Tax Rate" msgstr "" @@ -4126,8 +4126,8 @@ msgstr "" #: inc/list-tables/class-line-item-list-table.php:216 #: inc/tax/class-dashboard-taxes-tab.php:63 #: inc/tax/class-dashboard-taxes-tab.php:151 -#: inc/tax/class-tax.php:104 -#: inc/tax/class-tax.php:105 +#: inc/tax/class-tax.php:142 +#: inc/tax/class-tax.php:143 #: views/checkout/templates/order-summary/simple.php:188 msgid "Taxes" msgstr "" @@ -4937,7 +4937,7 @@ msgstr "" #: inc/admin-pages/class-tax-rates-admin-page.php:75 #: inc/admin-pages/class-tax-rates-admin-page.php:86 #: inc/admin-pages/class-tax-rates-admin-page.php:97 -#: inc/tax/class-tax.php:148 +#: inc/tax/class-tax.php:217 #: views/taxes/list.php:12 msgid "Tax Rates" msgstr "" @@ -16405,7 +16405,7 @@ msgstr "" #: views/sites/edit-placeholders.php:49 #: views/sites/edit-placeholders.php:177 #: views/taxes/list.php:102 -#: views/taxes/list.php:309 +#: views/taxes/list.php:313 msgid "Select All" msgstr "" @@ -18488,44 +18488,44 @@ msgstr "" msgid "Enable this option if your prices include taxes. In that case, Ultimate Multisite will calculate the included tax instead of adding taxes to the price." msgstr "" -#: inc/tax/class-tax.php:189 +#: inc/tax/class-tax.php:190 msgid "Regular" msgstr "" -#: inc/tax/class-tax.php:232 +#: inc/tax/class-tax.php:233 #: inc/ui/class-site-actions-element.php:184 #: views/limitations/plugin-selector.php:80 msgid "Default" msgstr "" -#: inc/tax/class-tax.php:295 +#: inc/tax/class-tax.php:296 msgid "You don't have permission to alter tax rates" msgstr "" -#: inc/tax/class-tax.php:314 +#: inc/tax/class-tax.php:315 msgid "No tax rates present in the request" msgstr "" -#: inc/tax/class-tax.php:346 +#: inc/tax/class-tax.php:347 msgid "Tax Rates successfully updated!" msgstr "" -#: inc/tax/class-tax.php:386 -#: inc/tax/class-tax.php:390 +#: inc/tax/class-tax.php:387 +#: inc/tax/class-tax.php:391 msgid "Manage Tax Rates" msgstr "" -#: inc/tax/class-tax.php:394 +#: inc/tax/class-tax.php:395 msgid "Add different tax rates depending on the country of your customers." msgstr "" -#: inc/tax/class-tax.php:400 +#: inc/tax/class-tax.php:401 msgid "You need to activate tax support first." msgstr "" -#: inc/tax/class-tax.php:408 -#: inc/tax/class-tax.php:414 -#: inc/tax/class-tax.php:418 +#: inc/tax/class-tax.php:409 +#: inc/tax/class-tax.php:415 +#: inc/tax/class-tax.php:419 msgid "Manage Tax Rates →" msgstr "" @@ -20923,22 +20923,22 @@ msgid "No items to display" msgstr "" #: views/sites/edit-placeholders.php:209 -#: views/taxes/list.php:342 +#: views/taxes/list.php:346 msgid "Add new Row" msgstr "" #: views/sites/edit-placeholders.php:215 -#: views/taxes/list.php:348 +#: views/taxes/list.php:352 msgid "Delete Selected Rows" msgstr "" #: views/sites/edit-placeholders.php:241 -#: views/taxes/list.php:374 +#: views/taxes/list.php:378 msgid "Save your changes!" msgstr "" #: views/sites/edit-placeholders.php:245 -#: views/taxes/list.php:378 +#: views/taxes/list.php:382 msgid "Saving..." msgstr "" @@ -20987,12 +20987,16 @@ msgstr "" msgid "Loading Tax Rates..." msgstr "" -#: views/taxes/list.php:244 -#: views/taxes/list.php:259 +#: views/taxes/list.php:221 +msgid "Apply to all countries" +msgstr "" + +#: views/taxes/list.php:250 +#: views/taxes/list.php:265 msgid "Leave blank to apply to all" msgstr "" -#: views/taxes/list.php:388 +#: views/taxes/list.php:392 msgid "Save Tax Rates" msgstr "" diff --git a/views/taxes/list.php b/views/taxes/list.php index 93267768b..d1d65a587 100644 --- a/views/taxes/list.php +++ b/views/taxes/list.php @@ -215,19 +215,23 @@ case 'country': ?> - - $country_name) : ?> + - + - + - + + +