Questions tagged [country-regions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
14
votes
6answers
11k views

How add indian State?

How to add Indian State lists to the corresponding country?
11
votes
6answers
20k views

How to Get country name from country code in Magento 2?

i want to get country name from country code, i got the country code from the data order like this : $data = $order->getShippingAddress()->getData(); $countryCode = $data['country_id']; echo $...
9
votes
2answers
1k views

Allow single county gives empty drop down options in front-end checkout Country field in Magento 2

We have configured Allow Countries to Canada in admin. On fronted, by default the checkout page country field is loading with Canada, but if we click on country drop down, empty drop-down fields are ...
8
votes
3answers
20k views

get all country names with their state and region code

Here is my Magento code: private function getAllCountry() { require_once("../app/Mage.php"); umask(0); Mage::app("default"); $countryName = Mage::getModel('directory/country')->...
7
votes
1answer
8k views

Magento2 How to get region name by id?

Like in magento1 is is there any method to retrive region name by id. $regionModel = Mage::getModel('directory/region')->load('region_id'); $region = $regionModel->getName(); I checked ...
6
votes
1answer
500 views

How to validate postal code by country id?

In Magento checkout there is a postal code verification for each country, now I want to implement it in different module for different case, how to do it if I already have the country id and postal ...
5
votes
0answers
885 views

How to make country_id/region_id/region to work in custom admin form?

I need country/region fields in custom form in admin panel. I have following fields: <field name="country_id"> <argument name="data" xsi:type="array"> <item ...
4
votes
2answers
2k views

Limit country drop down input field Magento 2

Currently my magento store shows all the country in shipping, billing, and register customer form. is there a way to show only some countries that i want ?
4
votes
3answers
11k views

Magento 2 - State/Province dropdown and Country Dropdown in Contact form

I need to add these 2 dropdowns to the contact form. How would I pull in those values for each dropdown?
4
votes
1answer
4k views

Shipping Error. Invalid value in Region ID field

Just testing my shipping for a logged-in customer on Magento 2.2.5 When I come to the checkout I get the following error. Please check the shipping address information. Invalid value of "183" ...
3
votes
3answers
9k views

Get Region Id given Region Code and country id

I need to get the region_id given the region_code and the country_id, but I cannot manage to achieve it. I've tried using the countryFactory and the regionFactory, but i do not understand what i'm ...
3
votes
1answer
3k views

magento 2 : Get country from IP address

How to get the name of the country from the ip address in magento 2. I think it will require me to use geoip, but I don't know how to do it. Any help?
3
votes
2answers
2k views

Magento 2, How regionUpdater is working?

I'm trying to figure out how regionUpdater works in Magento 2. Region Updater is when you select a country, Magento reloads the region field depending on which country was selected. I went to ...
3
votes
1answer
6k views

Magento2: How I can display country and region drop down fields to admin form in Magento2

I am developing a custom admin module. I have displayed country and region in admin custom module. It is working when I add country and region. But it is not working with edit action. How I can show ...
3
votes
3answers
432 views

Country options are not displayed when editing user address Magento 2.3.3

I have such a problem on Magento 2.3.3 I checked this logic on stock Magento 2.3.3 and it also appears there. Choose a 2-3 allowed countries. Then go to All Customer -> Customer Address Edit Form in ...
3
votes
2answers
1k views

How do I render country name from country_id in Adminhtml grids?

Is there a built-in column renderer for that, or should I build one myself?
3
votes
1answer
534 views

Magento 2 State Option

Our client wants us to make the state field as an optional one in the Checkout. In order to do this, we have removed all the countries from the required state option and set to "Yes" for allowing to ...
3
votes
3answers
1k views

Updating country name in magento 2

I need to change the name of country in magento store e.g. United Kingdom needs to be changed to Great Britain. How can I achieve this? I tried looking at the following tables ...
3
votes
1answer
851 views

Remove region from address information in checkout

How can I remove the region (code is <!-- ko text: address().region -->) from the address field, if customer is logged in (see screenshot). I have already removed {region} from the customer ...
2
votes
2answers
3k views

Onchange event in while country change in magento 2

I need to change city field as a select field while change country name as India. otherwise, it shows text field. I follow this link use @Idham Choudry answer, but its throw Uncaught TypeError: ...
2
votes
1answer
419 views

Country Name Correction - Magento 2.0.1

In checkout page I need to change country list. I can achieve this from admin side. Store->Configuration->General->General->Conutry Options. I have chosen India only but the frontend show Inde. Where ...
2
votes
1answer
314 views

Can't checkout when remove country field

I tried to hide the country field in the checkout page and billing page. Here's my code : <item name="region_id" xsi:type="array"> <item name="visible" xsi:type="boolean">false</...
2
votes
1answer
4k views

How to make the state/region optional in Magento 2.0.7?

In a Magento 2.0.7 with very little customization when we disable a country in State is Required for in Stores -> Configuration -> General -> State Options the state field in the checkout ...
2
votes
3answers
2k views

ui_component form state/region field update after country select (M 2.1)

I created form as a ui_component in my module. It has all data which is neccesary -> country list and region/state list. The only problem is the region field doesn`t update on country change. It ...
2
votes
0answers
107 views

Magento 2 Region list not filter for default country on billing address for first time

There are many country region available in region list. The issue arises first-time page load on the billing address of checkout. Even default country has been set up the USA, All region list has been ...
2
votes
0answers
128 views

Changing country name (Ireland to be Republic of Ireland) in Magento 2

I need to change Ireland to the Republic of Ireland. No matter what I change and clear the caches it does not update I have tried editing vendor/magento/zendframework1/library/Zend/Locale/Data/...
2
votes
1answer
61 views

Adding new regions won't persist

I followed an example and created a custom extension that would add some regions to the directory_country_region & directory_country_region_name tables. I want to make sure that the data I write ...
2
votes
0answers
231 views

Adding custom attributes to states and a dropdown to cities

I would like to change the way the users enter addresses, and I have several doubts about the best way to do it. First, I need to add a drop down for states/provinces to other countries, for what I'...
2
votes
0answers
81 views

synchronization between multiregion Shops

Our main business is in Germany and we try to sell our products in China. At first we used our existing infrastructure in Germany with new a new storeview, but the latency from China was very high. A ...
2
votes
1answer
2k views

Show State/Province code in address

When a customer make an order, in the shipping and billing address appears the extended Province name (for example "Lecce"). Is it possible to show the Region code "LE" instead of the Region name "...
2
votes
0answers
656 views

Magento 1.9 - PayPal Express mixes Magento's country with PayPal's address

I am in the process of updating a Magento 1.8 to 1.9.2.4. I am doing it on a local development environment. I have a custom theme and a fair number of plugins. My theme: http://themeforest.net/item/...
2
votes
2answers
3k views

Get Store/Website by Language/Country

Im searching since a week how i can get a store_id / website_id for a given language. Like: $countryId = 'DE'; // or country = Germany foreach (Mage::app()->getStores() as $store) { if($store-...
1
vote
2answers
2k views

Magento 2 - Get country name from country code

I want to get country name from country code, in Magento 1.9 I use the code like this to get country name: $countryCollection = Mage::getModel('directory/country_api')->items(); foreach($...
1
vote
1answer
1k views

How to load shipping methods on country and postcode change?

I have written a custom shipping module, then I want to change custom shipping methods when country and post code changes. I heard there is a method call js mixin. any one have idea about it, need ...
1
vote
5answers
1k views

Get the country code of website user

I want to get the country code of my website user so that I can show and hide some blocks in my code. How may I do that? For example if someone is browsing our website from Australia I should get AU. ...
1
vote
1answer
1k views

Magento 2: Update Region/States dropdown for Specific Country

I want to add only Nigeria as the option in Country Dropdown, and the nigerian states in the states/province dropdown. How to do that. I tried something through Admin panel, when i found these issues ...
1
vote
1answer
2k views

How to add new country in country dropdown in magento2.2.1

I want to add new country and its region in magento2.2.1 so it can be shown throughout the site(including backend countried dropdown, checkout at frontend). I have tried this link of magento1 but did ...
1
vote
2answers
4k views

Magento 2 - Get country in billing address

I'm trying to get the country name from billing address. I have the address object and I see that the attribute country_id is always No but I'm sure the country is existed as it is displayed properly ...
1
vote
2answers
493 views

Magento2: How to Modify DropDown Country options on the fly?

I need to create a restriction for the Billing [Country_Id] options Based on a new Config. Setting that Pairs a Customer-Segment with specific Billing Country options. I found: vendor/magento/...
1
vote
1answer
237 views

How can i add Country Name or flag Display on Ordered page Panel Grid?

I need to show Country Name or flag on ordered page, How can i add custom field on ordered panel grid?
1
vote
1answer
820 views

India is select than state and city should be display

If user select "INDIA" country in billing step on checkout step then indian state and city should be display in dropdown. My default country is "USA"
1
vote
2answers
55 views

Database error when i tried to add states in 'Default Tax Destination Calculation' [closed]

I am trying to add the States of India through database so that it will be available under the option system->configuration->sales->tax/Default Tax Destination Calculation in magento 1.9.2.2. I ...
1
vote
0answers
17 views

How to change the country code for a specific country

is it possible to change the country code for a specific country? DE -> GER Thanks in Advance!
1
vote
0answers
106 views

How to show state dropdown in phtml file in magento2

I want to show state drop down in phtml file in magento2 I have a country code <?php $countryBlock = $block->getLayout()- >createBlock('Magento\Directory\Block\Data');?> &...
1
vote
0answers
111 views

Same content (language) for multiple countries (store views)

I'm trying to implement an e-commerce site (using Magento 2) that has the following requirements: be available in N countries (eg http://example.com/country_code/ ) with X languages share the same ...
1
vote
1answer
94 views

My country is missing from the Countries Options in merchant location dropdown menu

I am looking for "Jordan" as the merchant location in the Countries Options dropdown list, but it is not there! It was in My previous version of 1.8 Any ideas on how to add it? Is this related to ...
1
vote
0answers
353 views

How to use region updater in magento 2 custom module?

I am working on the region updater in magento 2. Region Field needs to change based on the selection of country. Below is my region updater code: var billingRegionUpdater = new RegionUpdater('#...
1
vote
0answers
50 views

Module productive minds SiteSwitcher and changing countries

I have this module currently installed and when i use the top drop down Change Language it switches to the correct store utilizing the correct language and currency. No problem here, see picture below....
1
vote
0answers
1k views

Magento 2: How to Add Additional Countries?

Apart from Magento Default Country list. I have below Countries which needs to be added. MINE MAGENTO MAPPED ------------------------------------------- Antigua and Barbuda => ...
1
vote
1answer
114 views

Model override for regions not working

I'm trying to limit the states that show in the dropdown in the store. I thought that overriding the _initSelect() method in the app/code/core/Mage/Directory/Model/Resource/Region/Collection.php ...