@Damian Culotta, @Rakesh Jesadiya and @df2k2, all of you have collectively been very helpful in resolving this issue. And I'm thankful.
Hi @FlamyTech,
I've created a simple module to install the Nigeria regions.
The list of regions was copied from Wikipedia:
And now you can get the module from Github: https://github.com/barbanet/magento2-nigeriaregions
Or you can install it using Composer: https://packagist.org/packages/barbanet/magento2-nigeriaregions
Maybe this won't work for your current project but for others in the future.
@Damian Culotta, thanks a lot for your time and input.
I've solved the problem by creating the necessary CSV files and importing them into the database and after that, import the tablerates.csv into the Magento admin panel.
Hello @Damian Culotta, Thanks a lot for this. I tried to use it, but it looks like the module requires a lower PHP version (7.1). Can this be updated?
@FlamyTech wrote:@Rakesh Jesadiya, @Damian Culotta,
At a second check of the "directory_country_region" and "directory_country_region_name" tables, I realized that the last "region_id" is 511. So, I started with 512. I successfully imported the "directory_country_region.csv" and "directory_country_region_name.csv" to the appropriate tables via phpMyAdmin. Then, I tried importing "tablerates.csv" into Magento admin, but I got the following error message again:
We couldn't import this file because of these errors: Please correct Region/State "Abia" in the Row #2. Please correct Region/State "Abuja" in the Row #3. Please correct Region/State "Adamawa" in the Row #4. Please correct Region/State "Akwa Ibom" in the Row #5. Please correct Region/State "Anambra" in the Row #6. Please correct Region/State "Bauchi" in the Row #7. Please correct Region/State "Bayelsa" in the Row #8. Please correct Region/State "Benue" in the Row #9. Please correct Region/State "Borno" in the Row #10. Please correct Region/State "Cross River" in the Row #11. Please correct Region/State "Delta" in the Row #12. Please correct Region/State "Ebonyi" in the Row #13. Please correct Region/State "Edo" in the Row #14. Please correct Region/State "Ekiti" in the Row #15. Please correct Region/State "Enugu" in the Row #16. Please correct Region/State "Gombe" in the Row #17. Please correct Region/State "Imo" in the Row #18. Please correct Region/State "Jigawa" in the Row #19. Please correct Region/State "Kaduna" in the Row #20. Please correct Region/State "Kano" in the Row #21. Please correct Region/State "Katsina" in the Row #22. Please correct Region/State "Kebbi" in the Row #23. Please correct Region/State "Kogi" in the Row #24. Please correct Region/State "Kwara" in the Row #25. Please correct Region/State "Lagos" in the Row #26. Please correct Region/State "Nasarawa" in the Row #27. Please correct Region/State "Niger" in the Row #28. Please correct Region/State "Ogun" in the Row #29. Please correct Region/State "Ondo" in the Row #30. Please correct Region/State "Osun" in the Row #31. Please correct Region/State "Oyo" in the Row #32. Please correct Region/State "Plateau" in the Row #33. Please correct Region/State "Rivers" in the Row #34. Please correct Region/State "Sokoto" in the Row #35. Please correct Region/State "Taraba" in the Row #36. Please correct Region/State "Yobe" in the Row #37. Please correct Region/State "Zamfara" in the Row #38.What else can I do to successfully import the tablerates.csv? Thanks in advance.
Hi @FlamyTech,
How were you able to resolve this issue ? I am having the same error as above even after importing the two csv files: "directory_country_region.csv" and "directory_country_region_name.csv"
Can you help please? Thanks
I figured out the issue. For anybody having issues importing the tablerates.csv file even after importing the two csv files: directory_country_region.csv and directory_country_regions_name.csv with their respective region/state. Be sure to confirm that you are using the region code in both the tables.csv file and the directory_country_region.csv. Magento uses the region code and not the region name when importing the tablerates.csv file.