I want to implement flat rate shipping for magento 2 in New Zealand
I am unable to find region code list Like Auckland, Wellington, Christchurch and Dunedin etc
Please, anyone, guide me so that I find Region/State code.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityBy default, Magento does not include regions of New Zealand (and several other countries).
So there are three options:
1. You can set up your table rates based on post / zip codes
Note: As I had no need of adding additional regions to any version of Magento yet the following two points are not based on "hands-on practice"! Please make sure you keep backups of your system take your time to find the best fitting approach!
2. Or, if this is not sufficient to you you may refer to this article, that explains, how you can add new regions to Magento:
Basically you have to add your additional region data to the following two tables:
directory_country_region
directory_country_region_name
Demo insert SQL's as given on above link:
insert into directory_country_region (country_id, code, default_name) values ("NZ", "AU", "Auckland");
insert into directory_country_region (country_id, code, default_name) values ("NZ", "WE", "Wellington");
insert into directory_country_region (country_id, code, default_name) values ("NZ", "CC", "Christchurch");
insert into directory_country_region (country_id, code, default_name) values ("NZ", "DU", "Dunedin");
and
insert into directory_country_region_name values ("en_US", 507, "Auckland");
insert into directory_country_region_name values ("en_US", 508, "Wellington");
insert into directory_country_region_name values ("en_US", 509, "Christchurch");
insert into directory_country_region_name values ("en_US", 510, "Dunedin");
Note: It is generally a bad idea and practice to run insert/update/alter SQL statements directly against your store's database! However, this may at least help you to find the right track on how to approach your issue.
3. https://github.com/php-cuong/magento2-regions-manager - I just found this extension while I was looking for some references. It states that
This module provides flexibility of managing the regions for each country in your Magento Admin.
and seem to be an interesting hit on this topic.