nopCommerce icon indicating copy to clipboard operation
nopCommerce copied to clipboard

VAT (tax) calculation. Option to automatically detect a country

Open AndreiMaz opened this issue 2 years ago • 4 comments

nopCommerce version: 4.40.4

Originally the issue is described at https://www.nopcommerce.com/en/boards/topic/7455/vat-configuration-guide/page/3#286741

So there are two options to implement:

  1. Detect a country by IP address.
  2. Ask a customer to confirm a determined country with a popup window. For example, "Your country is [country_name]". And two options - the "Yes" button (confirm) and a dropdownlist to change it in case if it wasn't properly detected

Let's implement the first option only. So we'll detect the country automatically but at the same moment we'll also have an option to leave the existing logic:

  1. Currently we already have the "default tax address" block in the admin area > configuration > settings > tax settings
  2. Rename it to "Tax address (used for tax calculation)" instead of "Default tax address (used for tax calculation)"
  3. Let's add a new setting (checkbox) to this page - "Automatically detect a country by IP address". It'll be enabled by default
  4. When enabled we'll detect a customer country with GEO service (by IP address). And when enabled, the "default address" block will be hidden on this configuration page
  5. When disabled, we'll display the "Default tax address" block with all appropriate address fields. In this case, the old (existing) logic will be used

AndreiMaz avatar Jul 21 '21 04:07 AndreiMaz

If the country is detected automatically by IP address, how would an admin user be able to test that the tax rates are being applied correctly? I think an admin user would probably want to test this when working on tax rates by country. Perhaps providing Option 2 for admin users would achieve this?

rvrside avatar Jul 29 '21 14:07 rvrside

@rvrside If no country is specified in the registration/billing/shipping address, then it'll be detected by IP address. So a store owner will always be able to specify a country to test tax rates.

IP address will be used only when a country is not specified

AndreiMaz avatar Jul 29 '21 15:07 AndreiMaz

What about if my store IP is Azure Cloud IP, but I sale from Belorus , to Austria and Russia. Tax calculation for Austria and Russian is different and not connected only to Belorus. I think Not usable function

ecommerce-tester avatar Jul 30 '21 10:07 ecommerce-tester

What about if my store IP is Azure Cloud IP, but I sale from Belorus , to Austria and Russia. Tax calculation for Austria and Russian is different and not connected only to Belorus. I think Not usable fun

Client IP address will be used ofc.

devranerogul avatar Jun 06 '22 17:06 devranerogul