0

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.

1 Answer 1

0

By 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.