=== Aelia Prices by Country for WooCommerce ===
Tags: woocommerce, prices, pricing by country, multi-currency, international
Requires at least: 4.0
Tested up to: 6.8.9
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

== Description ==
Aelia Prices by Country for WooCommerce allows you to charge different prices for each product, depending on customer’s country. The plugin can also make one or more products unavailable, or completely hidden, to customer from specific countries.

= How it works =
Once enabled, the Prices by Country plugin will add a new menu item to the WooCommerce menu, which will lead to a page that you can use to configure one or more regions (a region is a list of countries). When you will have configured the regions, every product will show additional price fields for each of the regions. By entering a price in these new fields, you will be able to charge a different prices to your customers, depending on which country they will choose at checkout.

The Prices by Country plugin includes a geolocation feature, and it can detect visitors’ location automatically. By doing so, your customers will immediately see the prices that apply to their country, before they reach the checkout.

This product is fully compatible with [our WooCommerce Currency Switcher](https://aelia.co/shop/currency-switcher-woocommerce/), currently the leading multi-currency solution for WooCommerce. The combination of the two plugins will give you unprecedented flexibility: you will be able to enter different prices in each currency, for each of the regions you configure.

The Prices by Country plugin includes GeoLite data created by MaxMind, available from https://www.maxmind.com.

== Requirements ==

* WordPress 4.0 or newer.
* PHP 7.1 or newer.
* WooCommerce 3.0 or newer.
* Free [Aelia Foundation Classes framework](https://aelia.co/downloads/wc-aelia-foundation-classes.zip) 2.3.0.220730 or newer (the plugin can install the framework automatically).

== 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. Follow the instructions in our knowledge base to configure the Currency Switcher: [Aelia Currency Switcher - Getting Started](https://aelia.freshdesk.com/solution/articles/3000063641-aelia-currency-switcher-getting-started).

== Support ==
The Prices by Country plugin is backed by a top class support service, as well as a knowledge base to help you getting the best out of it. You can find them both here: [Prices by Country - Support Portal](https://aelia.freshdesk.com/support/solutions/120257).

== Changelog ==

= 1.18.5.250918 =
* Declared compatibility with WooCommerce 10.2.

= 1.18.4.250801 =
* Fix - Fixed glitch on the checkout block that caused the billing country to change the prices when the "prices based on" option is set to "shipping country".
* Declared compatibility with WooCommerce 10.1.

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

= 1.18.2.250617 =
* Declared compatibility with WooCommerce 9.9.

= 1.18.1.250414 =
* Declared compatibility with WordPress 6.8.9.

= 1.18.0.250409 =
* Fix - Fixed issue that prevented the country-specific prices from being loaded when using the cart and checkout blocks.
* Declared compatibility with WooCommerce 9.8.

= 1.16.3.250221 =
* Declared compatibility with WooCommerce 9.7.

= 1.16.2.250106 =
* Declared compatibility with WooCommerce 9.6.

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

= 1.16.0.241007 =
* Tweak - Optimised logic used to update the Geolocation database. The file is now downloaded only when the Aelia geolocation feature is required.
* Declared compatibility with WooCommerce 9.4.

= 1.15.17.240910 =
* Declared compatibility with WooCommerce 9.3.

= 1.15.16.240807 =
* Declared compatibility with WooCommerce 9.2.

= 1.15.15.240709 =
* Declared compatibility with WooCommerce 9.1.

= 1.15.14.240606 =
* Feature - Added filter `wc_aelia_pbc_hide_unavailable_products`.
* Feature - Added filter `wc_aelia_pbc_should_filter_catalogue_products`.
* Declared compatibility with WooCommerce 9.0.

= 1.15.13.240514 =
* Declared compatibility with WooCommerce 8.9.

= 1.15.12.240414 =
* Declared compatibility with WooCommerce 8.8.

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

= 1.15.10.240205 =
* Declared compatibility with WooCommerce 8.6.

= 1.15.9.240117 =
* Tweak - Fixed minor glitch in the Edit Product UI for simple products.

= 1.15.8.240109 =
* Declared compatibility with WooCommerce 8.5.

= 1.15.7.231213 =
* Declared compatibility with WooCommerce 8.4.

= 1.15.6.231201  =
* Updated Composer dependencies.

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

= 1.15.4.231003 =
* Updated supported WooCommerce versions.

= 1.15.3.230905 =
* Updated supported WooCommerce versions.

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

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

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

= 1.14.13.230524 =
* Updated supported WooCommerce versions.

= 1.14.12.230515 =
* Fix - Fixed recalculation of minicart total upon the selection of a country via the country selector widget.

= 1.14.11.230511 =
* Fix - Tweaked logic used to trigger the recalculation of taxes on page load when taxes are based on the shipping address.

= 1.14.10.230503 =
* Updated supported WooCommerce versions.

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

= 1.14.8.230315 =
* Fix - Handled condition that could cause a product's regional sale prices to be set to zero at the end of a sale, under PHP 8.x.
* Updated supported WooCommerce versions.

= 1.14.7.230214 =
* Updated supported WooCommerce versions.

= 1.14.6.230109 =
* Updated supported WooCommerce versions.

= 1.14.5.221203 =
* Updated supported WooCommerce versions.

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

= 1.14.3.221012 =
* Updated supported WooCommerce versions.

= 1.14.2.220908 =
* Fix - Fixed condition that caused the state/province selected by the customer on the checkout page to be "forgotten" during the actual checkout process.
* Updated supported WooCommerce versions.

= 1.14.1.220830 =
* Updated supported WooCommerce versions.

= 1.14.0.220730 =
* Improved compatibility with PHP 8.2. Introduced new logic to track auxiliary object data, without relying on dynamic properties.
* Updated supported WooCommerce versions.

= 1.13.5.220704 =
* Updated supported WooCommerce versions.

= 1.13.4.220607 =
* Updated supported WooCommerce versions.

= 1.13.3.220516 =
* Feature - Added optional logic to recalculate taxes when the user changes the country using the selector widget.

= 1.13.2.220502 =
* Updated supported WordPress versions.

= 1.13.1.220425 =
* Fix - Fixed notice about missing "price" property. Ref. issue #4.
* Updated supported WooCommerce versions.

= 1.13.0.220405 =
* Tweak - Rewritten logic used to filter visible products from the product query. The new logic loads products in batches, trading some performance for lower memory consumption.

= 1.12.11.220330 =
* Updated supported WooCommerce versions.

= 1.12.10.220224 =
* Updated supported WooCommerce versions.

= 1.12.9.220124 =
* Updated supported WooCommerce versions.

= 1.12.8.220104 =
* Updated supported WooCommerce versions.

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

= 1.12.6.211102 =
* Updated supported WooCommerce versions.

= 1.12.5.211005 =
* Updated supported WooCommerce versions.

= 1.12.4.210906 =
* Updated supported WooCommerce versions.

= 1.12.3.210816 =
* Updated supported WordPress and WooCommerce versions.

= 1.12.1.210607 =
* Tweak - Renamed plugin, for naming consistency.
* Tweak - Added plugin icon for the Freemius integration.

= 1.12.0.210527 =
* Added Freemius integration.
* Updated requirements.

= 1.11.10.210430 =
* Tweak - Added check to skip prices in invalid currencies. This will avoid errors when currencies that were used in the past are no longer enabled.
* Updated supported WooCommerce versions.

= 1.11.9.210406 =
* Updated supported WooCommerce versions.

= 1.11.7.210304 =
* Tweak - Improved support for variable subscriptions when the Currency Switcher is not active.
* Fix - Fixed logic used to cache and fetch the list of visible products. This should also fix the issue that caused a 404 error in some cases.
* Updated supported WooCommerce versions.

= 1.11.5.201201 =
* Tweak - Removed logic used to set cookie `aelia_customer_state`, which is handled by the Tax Display by Country plugin. The logic used to read that cookie has been preserved.
* Updated supported WooCommerce versions.

= 1.11.4.201103 =
* Updated supported WooCommerce versions.

= 1.11.1.200904 =
* Fix - Fixed logic to clear the regional sale prices at the end of a scheduled sale.
* Updated supported WordPress and WooCommerce versions.

= 1.10.5.200813 =
* Updated supported WordPress and WooCommerce versions.

= 1.10.5.200625 =
* Updated supported WooCommerce versions.

= 1.10.5.200529 =
* Feature - Improved support for manual orders. Added logic to load product prices based on the billing or shipping country set for the order.

= 1.10.4.200526 =
* Feature - Improved integration with WooCommerce import/export features. The tool now shows dedicated columns to import and export the custom data from the Prices by Country plugin.
* Updated supported WooCommerce versions.

= 1.10.3.200514 =
* Tweak - Added new filter `wc_aelia_pbc_filter_visible_products_hash`. The filter allows 3rd parties to use custom criteria to generate the cache key for the list of visible products.

= 1.10.2.200506 =
* Fix - Fixed error that prevented variation prices from being saved in some cases.

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

= 1.10.0.200423 =
* Tweak - Removed calls to deprecated function `get_value()`.
* Fix - Fixed logic used to filter the product query when option "Filter invisible products from the catalogue query", to reduce the possibility of conflicts.
* Updated supported WooCommerce versions.

= 1.9.11.200310 =
* Updated supported WooCommerce versions.

= 1.9.11.200213 =
* Tweak - Added new filters `wc_aelia_pbc_set_customer_billing_location` and `wc_aelia_pbc_set_customer_shipping_location`, to allow 3rd parties to prevent setting the billing or shipping location.
* Removed legacy code.

= 1.9.10.200205 =
* Fix - Fixed "invalid variable reference" error in checkout process.

= 1.9.9.200203 =
* Tweak - Updated country selector widget. Replaced argument "aelia_billing_country" with "aelia_customer_country".
* Tweak - Improved checks on checkout page, to ensure that the correct country (billing or shipping) is used to load the product prices.
* Updated supported WooCommerce versions.

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

= 1.9.7.191120 =
* Fix - Fixed error related to missing function `WC_Aelia_Prices_By_Country::tax_based_on()`.

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

= 1.9.6.191015 =
* Optimised geolocation logic.
* Updated supported WooCommerce versions.

= 1.9.5.191011 =
* Improvement - Added bulk edit of regional availability for variations.
* Tweak - Improved admin UI for variations on Edit Product page.

= 1.9.4.191003 =
* Tweak - Improved compatibility with shipping methods and the shipping calculator widget on cart page.
* Tweak - Improved checks for the presence of cart fragments in frontend scripts.

= 1.9.3.190925 =
* Updated supported WooCommerce versions.

= 1.9.2.190402 =
* Fix - Fixed calculation of product prices on Cart > Shipping Calculator, in WooCommerce 3.2 and later.
* Compatibility with WooCommerce 3.6.x.

= 1.9.1.181211 =
* Updated supported WooCommerce versions.
* Updated language files.

= 1.9.0.181128 =
* Feature - Added filtering of the query used to populate the catalogue, to produce a more accurate pagination.

= 1.8.10.181124 =
* Fix - Updated "product is on sale" check, to take into account the time zone.
* Updated supported WooCommerce version.
* Updated supported WordPress version.

= 1.8.9.181009 =
* Updated supported WooCommerce version.

= 1.8.8.180629 =
* Tweak - Refined check for unavailability of products, to distinguish between "unavailable for country" and "unavailable for other reasons".

= 1.8.7.180530 =
* Updated supported WooCommerce version.

= 1.8.6.180416 =
* Tweak - Improved support for WooCommerce's native import/export features.

= 1.8.5.180206 =
* Tweak - Optimised logic to determined when the user's billing and shipping country loaded from the user meta should be overridden.

= 1.8.4.180111 =
* Feature - Added option to disable the pre-population of billing and shipping country at checkout.

= 1.8.3.180106 =
* Tweak - Added logic to set the active country when the billing or shipping country is changed in the My Account page.

= 1.8.2.171106 =
* Tweak - Added filter to allow changing the selected country dynamically.

= 1.8.1.171030 =
* Tweak - Improved support for native product export feature, to ensure the exporting of the prices by country associated to products. Note: requires WooCommerce 3.2.2 or newer.

= 1.8.0.171012 =
* Fix - Fixed bug that prevented grouped products from being purchased.

= 1.7.18.170912 =
* Fix - Improved logic used to ensure that minicart is updated when the currency changes, to handle the new "hashed" cart fragment IDs.

= 1.7.17.170829 =
* Tweak - Added debug mode option.
* Feature - Added support for auto-updates.

= 1.7.16.170616 =
* Fix - Fixed logic used to change visibility of variations.

= 1.7.15.170612 =
* Fix - Optimised processing of product variations to prevent timeouts and out of memory errors.
* Tweak - Removed notice in WooCommerce 3.x.

= 1.7.15.170607 =
* Improved compatibility with Subscriptions 2.2.7
	* Altered pricing logic to ensure that sign up fees are loaded correctly.

= 1.7.14.170602 =
* Fix - Region-specific pricing logic now takes into account the product base currency.
* Feature - New `wc_aelia_pbc_get_customer_region` filter.

= 1.7.13.170505 =
* Improved compatibility with WooCommerce 3.0.5:
	* Handled edge condition that could prevent the Variations tab from loading in the Edit Product page.

= 1.7.12.170419 =
* Improved compatibility with WooCommerce 3.0.1:
	* Fixed notice due to a direct call to `$product->id`.

= 1.7.12.170407 =
* Improved compatibility with WooCommerce 3.0.1:
	* Fixed bug caused by WooCommerce 3.0.1 returning dates as objects, instead of timestamps.

= 1.7.11.170405 =
* Improved compatibility with Subscriptions 2.2.
	* Added handling of the "legacy" products added in the new version of the Subscriptions plugin.

= 1.7.10.170325 =
* Improved compatibility with WooCommerce 3.0:
	* Fixed notice related to the checkout country at checkout.

= 1.7.9.170306 =
* Improved compatibility with WooCommerce 2.7:
	* Replaced call to `WC_Customer::get_country()` with `WC_Customer::get_billing_country()` in WC 2.7 and newer.
	* Replaced call to `WC_Product::get_price_including_tax()` and `WC_Product::get_price_excluding_tax()` with the new `wc_get_price_including_tax()` and `wc_get_price_excluding_tax()` functions.

= 1.7.9.170214 =
* Improved compatibility with WooCommerce 2.7:
	* Refactored currency conversion logic to follow the new guidelines.
	* Replaced obsolete filters.
	* Added support for the new logic for the conversion of variable products.
	* Improved UI in Edit Product page.
* Dropped support for WooCommerce 2.3 and earlier.

= 1.7.6.170202 =
* Improved logic to determine if a product is on sale. The new logic can fix incompatibility issues with 3rd party plugins, such as Bundles.
