Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions inc/functions/tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions inc/tax/class-tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public function add_settings(): void {
],
]
);

}

/**
Expand Down
54 changes: 29 additions & 25 deletions lang/ultimate-multisite.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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 ""
Expand Down Expand Up @@ -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 ""
Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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 ""

Expand Down
18 changes: 11 additions & 7 deletions views/taxes/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,23 @@
case 'country':
?>

<select v-cloak v-model="item.<?php echo esc_attr($key); ?>" style="width: 100%;">
<select v-cloak v-model="item.<?php echo esc_attr($key); ?>" style="width: 100%;">

<?php foreach (wu_get_countries_as_options() as $country_code => $country_name) : ?>
<option value="*">
<?php esc_html_e('Apply to all countries', 'ultimate-multisite'); ?>
</option>

<option value="<?php echo esc_attr($country_code); ?>">
<?php foreach (wu_get_countries_as_options() as $country_code => $country_name) : ?>

<?php echo esc_html($country_name); ?>
<option value="<?php echo esc_attr($country_code); ?>">

</option>
<?php echo esc_html($country_name); ?>

<?php endforeach; ?>
</option>

</select>
<?php endforeach; ?>

</select>

<?php
break;
Expand Down