=== WooCommerce Tax Display by Country ===
Tags: woocommerce, aelia, tax display, geolocation, tax geolocation
License: GPL-3.0
Requires at least: 4.0
Tested up to: 7.0.9

Allows to display prices including/excluding tax depending on customer's location.

== Description ==
This plugin allows to specify how prices should be displayed (with or without tax) to customers from different countries. Thanks to this plugin, you will be able to display prices "all inclusive" to some customers, and prices excluding tax/VAT to others, making your pricing policy clearer.

== Requirements ==
* WordPress 3.6 or newer.
* PHP 7.1 or newer.
* WooCommerce 3.0 or newer.
* [AFC plugin for WooCommerce](https://aelia.co/downloads/wc-aelia-foundation-classes.zip) 2.1.9.210525 or later.

== Installation ==
1. Extract the zip file and drop the contents in the wp-content/plugins/ directory of your WordPress installation.
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to WooCommerce > Tax Display by Country to configure how the prices will be displayed, based on the countries you will indicate.
4. Optionally, go to Appearance > Widgets and display the Billing Country Selector widget wherever you like. Alternatively, you can display the widget usinga shortcode. Please refer to the instructions on the Tax Display by Country page for more details.
5. That's it! Now your Customers will be able to select the billing country when they visit your shop, and see the prices with/without taxes, as you specified.

== Changelog ==

= 1.22.3.260518 =
* Declared compatibility with WooCommerce 10.8.

= 1.22.2.260413 =
* Declared compatibility with WooCommerce 10.7.
* Declared compatibility with WordPress 7.0.9.

= 1.22.1.260311 =
* Declared compatibility with WooCommerce 10.6.

= 1.22.0.260131 =
* Declared compatibility with WooCommerce 10.5.
* Declared compability with product instance caching feature.
* Tweak - Added workaround for WooCommerce issue #63053, caused by the StoreApi replacing the default session handler with its own.

= 1.21.11.251210 =
* Declared compatibility with WooCommerce 10.4.

= 1.21.10.251208 =
* Tweak - Added logic to determine the correct prefix for the scripts bundled with WooCommerce.
* Declared compatibility with WooCommerce 10.4.
* Declared compatibility with WordPress 6.9.9.

= 1.21.9.251024 =
* Declared compatibility with WooCommerce 10.3.

= 1.21.8.250918 =
* Fix - Fixed condition that prevented the Stripe gateway from fetching the State during the checkout process for guest users.
* Declared compatibility with WooCommerce 10.2.
* Tweak - Improved compatibility with PHP 8.4.

= 1.21.7.250801 =
* Fix - Fixed glitch on the checkout block that caused the billing country to be tracked even if the taxes are based on the shipping country.
* Declared compatibility with WooCommerce 10.1.

= 1.21.6.250714 =
* Declared compatibility with WooCommerce 10.0.
* Declared compatibility with Cost of Goods feature.

= 1.21.5.250617 =
* Declared compatibility with WooCommerce 9.9.

= 1.21.4.250414 =
* Declared compatibility with WooCommerce 9.8.
* Declared compatibility with WordPress 6.8.9.

= 1.21.3.250221 =
* Declared compatibility with WooCommerce 9.7.

= 1.21.2.250106 =
* Declared compatibility with WooCommerce 9.6.

= 1.21.1.241202 =
* Declared compatibility with WooCommerce 9.5.
* Declared compatibility with WordPress 6.7.9.

= 1.21.0.241007 =
* Feature - Added integration with the new geolocation logic in the AFC 2.6.x.
* Declared compatibility with WooCommerce 9.3.

= 1.20.19.240910 =
* Declared compatibility with WooCommerce 9.3.

= 1.20.18.240807 =
* Declared compatibility with WooCommerce 9.2.

= 1.20.17.240709 =
* Declared compatibility with WooCommerce 9.1.

= 1.20.16.240624 =
* Tweak - Removed border from wrapper `<div>` element on the settings page.

= 1.20.15.240606 =
* Declared compatibility with WooCommerce 9.0.

= 1.20.14.240514 =
* Declared compatibility with WooCommerce 8.9.

= 1.20.13.240414 =
* Declared compatibility with WooCommerce 8.8.

= 1.20.12.240307 =
* Declared compatibility with WooCommerce 8.7.
* Declared compatibility with WordPress 6.5.9.

= 1.20.11.240214 =
* Fix - PHP 8.2 deprecation notice. Ensured that the price suffix is a string, before passing it to the `wp_kses_post()` function.

= 1.20.10.240205 =
* Declared compatibility with WooCommerce 8.6.

= 1.20.9.240109 =
* Declared compatibility with WooCommerce 8.5.

= 1.20.8.231213 =
* Declared compatibility with WooCommerce 8.4.

= 1.20.7.231115 =
* Updated 3rd party dependencies.
* Fixed condition that could generate a duplicate Composer class name and trigger a fatal error.

= 1.20.6.231102 =
* Declared compatibility with WooCommerce 8.3.
* Declared compatibility with WordPress 6.4.x.

= 1.20.5.231003 =
* Updated supported WooCommerce versions.

= 1.20.4.230905 =
* Updated supported WooCommerce versions.

= 1.20.3.230809 =
* Updated supported WooCommerce versions.
* Updated supported WordPress versions.

= 1.20.3.230830 =
* Feature - Added filter `wc_aelia_tdbc_customer_is_tax_exempt`. The filter allows 3rd parties to flag a visitor as "tax exempt" based on custom criteria.

= 1.20.2.230718 =
* Compatibility - Fixed conflict with EU VAT Number plugin that prevented it from fetching the correct address to determine a VAT exemption.

= 1.20.1.230712 =
* Tweak - Handled edge case where the AFC is disabled, preventing the plugin from declaring support for the HPOS feature.

= 1.20.0.230705 =
* Declared compatibility with the HPOS feature.
* Updated supported WooCommerce versions.

= 1.19.5.230524 =
* Updated supported WooCommerce versions.

= 1.19.4.230503 =
* Updated supported WooCommerce versions.

= 1.19.3.230406 =
* Updated supported WooCommerce versions.
* Updated supported WordPress versions.

= 1.19.2.230315 =
* Updated supported WooCommerce versions.

= 1.19.1.230214 =
* Updated supported WooCommerce versions.

= 1.19.0.230206 =
* Tweak - Improved support for the WooCommerce checkout block, to detect the changes in the billing and shipping country.

= 1.18.9.230109 =
* Updated supported WooCommerce versions.

= 1.18.8.221203 =
* Updated supported WooCommerce versions.

= 1.18.7.221110 =
* Updated supported WooCommerce versions.
* Updated supported WordPress versions.

= 1.18.6.221012 =
* Updated supported WooCommerce versions.

= 1.18.5.220830 =
* Updated supported WooCommerce versions.

= 1.18.4.220804 =
* Updated supported WooCommerce versions.

= 1.18.3.220704 =
* Updated supported WooCommerce versions.

= 1.18.2.220607 =
* Updated supported WooCommerce versions.

= 1.18.1.220502 =
* Updated supported WooCommerce versions.
* Updated supported WordPress versions.

= 1.18.0.220401 =
* Feature - Added option to take customer's location from the profile upon login. When enabled, the location from the profile overrides the existing selection.
* Tweak - Rewritten settings page to use the latest settings API.
* Updated supported WooCommerce versions.

= 1.17.14.220224 =
* Updated supported WooCommerce versions.

= 1.17.13.220124 =
* Updated supported WooCommerce versions.

= 1.17.12.220104 =
* Updated supported WooCommerce versions.

= 1.17.11.211208 =
* Updated supported WooCommerce versions.
* Updated supported WordPress versions.

= 1.17.9.211111 =
* Tweak - Performance optimisation. The plugin now sends the country and state cookies to the browser only when their value has changed.

= 1.17.9.211102 =
* Updated supported WooCommerce versions.

= 1.17.8.211005 =
* Updated supported WooCommerce versions.

= 1.17.7.210825 =
* Updated language files.

= 1.17.6.210813 =
* Fix - Fixed bug that caused the "Change Location" button to stay hidden when the "Handle customer's State/County/Province" option was enabled.

= 1.17.5.210810 =
* Updated supported WordPress and WooCommerce versions.

= 1.17.4.210706 =
* Tweak - Tweaked country selector widget. Wrapped "Change Location" button in a `<noscript>` tag. That button is only needed when JavaScript is not enabled.

= 1.17.3.210623 =
* Fix - Fixed notice about the "state_label" attribute, which appeared when saving the widget settings if the State Label field was not filled.

= 1.17.2.210622 =
* Updated supported WooCommerce versions.
* Updated supported WordPress versions.

= 1.17.1.210607 =
* Tweak - Added plugin icon for the Freemius integration.

= 1.17.0.210511 =
* Feature - Added Freemius integration.
* Tweak - Updated settings page to include the Freemius contact form and account page.
* Updated requirements.
* Updated supported WooCommerce versions.

= 1.16.0.210504 =
* Tweak - Moved plugin to the internal marketplace and licensing system.
* Updated supported WooCommerce versions.

= 1.15.10.210406 =
* Fix - Fixed fatal error that appeared when an invalid custom widget was passed to the plugin.
* Updated supported WooCommerce versions.

= 1.15.9.210317 =
* Tweak - Removed obsolete admin message.
* Updated supported WooCommerce and WordPress versions.

= 1.15.8.210203 =
* Fix - Added check to ensure that the geolocation only sets the state when the "handle state" option is enabled.

= 1.15.7.210128 =
* Updated supported WooCommerce versions.

= 1.15.6.210118 =
* Updated requirements and supported WooCommerce versions.

= 1.15.5.201201 =
* Tweak - Added check to store and read cookie `aelia_customer_state` only when option "handle customer's state" is enabled.
* Tweak - Removed legacy code for WooCommerce 2.6 and older.
* Updated supported WooCommerce versions.

= 1.15.4.201103 =
* Removed upgrade message related to the new country selector plugin. The message is no longer relevant in new versions of the plugin.
* Updated supported WooCommerce versions.

= 1.15.3.201029 =
* Tweak - Moved logic to store the "I'm VAT exempt" selection to run earlier. This is to reduce the possibility that the related cookie can't be stored due to other actors sending output to the browser.
* Updated supported WooCommerce versions.

= 1.15.2.201005 =
* Updated supported WooCommerce versions.
* Updated supported WordPress versions.

= 1.15.1.200904 =
* Updated supported WooCommerce versions.

= 1.15.0.200813 =
* Updated supported WordPress and WooCommerce versions.

= 1.15.0.200723 =
* Feature - Extended the "fixed product prices" feature to  support "create order" and "update order" REST API calls.

= 1.14.0.200625 =
* Updated supported WooCommerce versions.

= 1.14.0.200608 =
* Improvement - Extended "fixed product prices" feature to support manual orders.

= 1.13.2.200603 =
* Updated supported WooCommerce versions.

= 1.13.1.200428 =
* Updated requirement checking class.
* Updated requirements.
* Updated supported WooCommerce versions.

= 1.13.0.200402 =
* Improvement - Improved support for manual orders in "fixed product prices" feature.

= 1.12.4.200323 =
* Updated supported WooCommerce versions.

= 1.12.3.200203 =
* Tweak - Improved logic used to detect the country selection when taxes are calculated based on shipping country.

= 1.12.2.200127 =
* Fix - Fixed incorrect tax calculation with "fixed prices" option in WooCommerce 3.9.
* Updated supported WooCommerce versions. Minimum version is now WC 3.5.

= 1.12.1.191220 =
* Tweak - Removed logic used to set city and post code, as they are not used by the plugin.
* Updated supported WooCommerce versions.

= 1.12.0.191028 =
* Fix - Fixed bug caused by function `WC_Customer::set_location()`, which caused customer's address to be empty on the checkout page.

= 1.11.1.191015 =
* Fix - Fixed call to filter `widget_title`.
* Updated supported WooCommerce versions.

= 1.11.0.190719 =
* Tweak - Dropped usage of obsolete cookie "aelia_billing_country".

= 1.10.2.190615 =
* Feature - Added support for placeholders `{price_including_tax}` and `{price_excluding_tax}` in the price suffix.

= 1.10.1.190509 =
* Fix - Fixed bug on the checkout page, which caused the shipping country to be ignored when the "Ship to another address" option was selected.

= 1.10.0.190322 =
* Tweak - Added check on frontend script, to handle the case where the `wc_cart_fragments_params` variable has been removed by disabling WooCommerce's cart fragments.
