Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better country management #233

Open
JamesRamm opened this issue Apr 14, 2019 · 1 comment
Open

Better country management #233

JamesRamm opened this issue Apr 14, 2019 · 1 comment

Comments

@JamesRamm
Copy link
Collaborator

Description

Currently, the site admin/developer needs to call loadcountries on initial setup to get the basic list of countries loaded in.
This is:

  • Out of date - it is a hardcoded list so can easily fall out of date
  • Not flexible - no info on regions etc. More often than not, a site admin will want to set shipping rates for a block of countries (e.g. all EU, Rest Of World) rather than per country, which is tedious.

So this issue proposes to:

  1. Use 'RESTCountries' (https://restcountries.eu/#api-endpoints-region) or similar API to get the country list. This will also provide more info on regions etc which can be used in the admin filter
  2. Provide a 'rest of world' option in shipping rates to apply a shipping rate to all countries not previously selected.

Implementation details:

  • It implies that the 'Country' db object will no longer be necessary. We will need to decide how dependent objects identify countries now (code?).
@akshayaureatelabs
Copy link

Description

Currently, the site admin/developer needs to call loadcountries on initial setup to get the basic list of countries loaded in. This is:

  • Out of date - it is a hardcoded list so can easily fall out of date
  • Not flexible - no info on regions etc. More often than not, a site admin will want to set shipping rates for a block of countries (e.g. all EU, Rest Of World) rather than per country, which is tedious.

So this issue proposes to:

  1. Use 'RESTCountries' (https://restcountries.eu/#api-endpoints-region) or similar API to get the country list. This will also provide more info on regions etc which can be used in the admin filter
  2. Provide a 'rest of world' option in shipping rates to apply a shipping rate to all countries not previously selected.

Implementation details:

  • It implies that the 'Country' db object will no longer be necessary. We will need to decide how dependent objects identify countries now (code?).

Hi @JamesRamm,

Thank you for highlighting the issues with the current setup and proposing a solution. We agree that relying on a hardcoded list of countries can be problematic and not flexible enough for various use cases.

To address these concerns, we propose the following implementation details:

  1. Utilize the 'RESTCountries' API (https://restcountries.eu/#api-endpoints-region) or a similar API to fetch the country list dynamically. This API will provide up-to-date information on countries, including regions, and additional details that can be useful for filtering in the admin panel.

  2. With the new approach, the 'Country' database object will no longer be necessary since we will fetch country data from the API directly. Instead, we need to update the dependent objects (code) to identify countries using the country codes or other unique identifiers provided by the API.

  3. Introduce a "rest of world" option in the shipping rates configuration. This option will allow site admins to set a shipping rate that applies to all countries not previously selected. This will make it easier to manage shipping rates for groups of countries, such as the EU or the rest of the world.

By implementing these changes, we can ensure that the country list remains up to date and provide more flexibility in managing shipping rates based on regions or country groups.

If you have any further questions or need clarification on any aspect of the proposed implementation, please let us know.

Thank you for your attention to this matter.

Best regards,
Akshaykumar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants