Magento Tutorials

How to Add New Region For a Specific Country Magento 2?

In todayā€™s Magento 2 tutorial blog, I will justify How to Add New Region for Specific Country in Magento 2.

When a customer creates an account for your Magento 2 store, it is necessary to enter the address so that in the future while placing an order, the customer can use the saved address. Also while tax implementation, the admin requires the customerā€™s region and pin code to apply special rules. Magento 2 maintains the database to allow customers to select their country, state, and region.

If any region is missing or if a new region is added, at that time the developer needs to add a new region of the country in the database. Integrate Magento 2 City and Region Manager Module to add custom shipping regions and show in the store frontend.

For now, letā€™s look at the method to Add New Region For Specific Country in Magento 2.

How to Add New Region For Specific Country in Magento 2:

You need to run the below SQL Query:

Syntax:

INSERT INTO ā€˜directory_country_regionā€™ (ā€˜country_idā€™, ā€˜codeā€™, ā€˜default_nameā€™, ā€˜state_codeā€™) VALUES ('country id', 'region code', 'region nameā€™, 'state codeā€™);

Example 1:

INSERT INTO `directory_country_region` (`country_id`, `code`, `default_name`, `state_code`) VALUES ('US', 'CS', 'Custom State', '45');

Executing the above SQL query will give you the below results

Example 2:

INSERT INTO `directory_country_region` (`country_id`, `code`, `default_name`, `state_code`) VALUES ('IN', 'IS', 'Indian State', '46');

Executing the above SQL query will give you the below results

Wrap Up:

This way you can easily Add New Region For Specific Country in Magento 2. Dropdown your queries in the comment box. Share the article further and stay connected for more.

Happy Reading!

Click to rate this post!
[Total: 3 Average: 5]
Gaurav Jain

Gaurav Jain is Co-Founder and Adobe Certified Expert-Magento Commerce Business Practitioner. Being Computer EngineeršŸ‘Øā€šŸ’» and possessing Extensive Marketing skills he handles all kinds of customer Queries and his HappyšŸ˜€ & HelpingšŸ™ Nature makes customer's day Delightful. When he isnā€™t working, youā€™ll find Gaurav Reading on BooksšŸ“– or TravelingšŸš—. Also, he is Speaker at Magento Meetups.

Recent Posts

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

2 days ago

Magento 2 Extensions Digest April 2024 (New Release & Updates)

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

2 days ago

The ABCs of Geofencing: Definition, Features and Uses

In this era, businesses are always on the lookout for ways to engage with their…

3 days ago

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

4 days ago

6 Innovative Tools Revolutionizing E-Commerce Operations

E-commerce has transformed the way consumers shop for products and services and interact with businesses.…

6 days ago

How Upcoming Cookie Changes Will Affect Your E-commerce Website?

The e-commerce world is constantly in flux. New tech and strategies emerge daily to help…

6 days ago