Questions tagged [country-regions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
0
votes
0answers
13 views

How to change currency on country change in shipping form in the checkout page magento 2.3

I want to update my checkout cart summary when the user selects the country from shipping address, cart price and currency change according to the country he selected in the shipping address. How can ...
-1
votes
1answer
18 views

How to set region value in checkout page?

I am following this guide to build a zipcode lookup implementation. I try to populate region, city and street data based on zipcode. this.region().value(regionValue); this.city().value(cityValue); ...
0
votes
0answers
10 views

Few product restrict for specific countries/state : M2

I want to restrict some products to show in a particular country/state, Not all products. Can you please suggest me how to achieve it? Thanks in advanced!
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. ...
0
votes
1answer
14 views

Region field is not working on country change

I am facing an issue in magento 2.3.4.Whenever I tried to change country, region field hidden and gives required error. Therefore, Place order is not happening. If i have not changed country and just ...
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-...
0
votes
1answer
755 views

Magento 2.2.4 Change Country Names

I am wanting to change the names in English for countries in Magento 2.2.4. I tried looking through the database but it appears their full name is not listed there, just country codes. For my use of ...
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!
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 ...
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 "...
0
votes
1answer
26 views

Magento2: How to add Country and State field at backend in creating customer under the Account Information tab?

I want to add country and State field at the backend in creating customer under the Account Information tab. Based on the Country selected the State should filter in the dropdown. Any help would ...
0
votes
2answers
221 views

Add Country field in custom Checkout form in Magento2

I added new step on checkout and I created a form for this new step. How can I add Magento built-in Country drop down field and state/province drop down field to my custom checkout form?
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 $...
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?
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?
0
votes
1answer
45 views

Magento 2 Update Ragion/State in Database

I found some regions in a specific countries are obsolete and new ones are missing. I know how to add region by installData.php in a custom module but i dont know how to remove the obsolete ones. ...
0
votes
1answer
126 views

How to get only one Specific Country's States/Province in dropdown?

I'm working on Magento 2.3.2, I override a Shipping Method file which is system.xml for adding custom fields. Here it is: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
2answers
93 views

Magento 2: Add CSS class for country input in address?

In the address section at My account dashboard, there is a field called Country. I want to change the CSS for that country's input. Where do I need to add CSS class in order to change it? <div ...
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')->...
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 ...
0
votes
0answers
32 views

Mangeto2.3.0 How to add country drop-down with tool-tip help in billing-address form?

I am using Mangeto2.3.0 i need to add tooltip help "?" define with county filed. I am trying to vendor module-checkout inside layoutprocessor.php override but not working on it.if anyone idea reply me ...
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: ...
0
votes
0answers
22 views

Magento 2: Is region_id for country/states get changes for Magento versions or in others modes?

2.3.1 Enterprise Edition. Am little bit confused for future usage of Country and Regions for form XML? here am getting the only region_id during form submit. am not able to get the code name of ...
0
votes
0answers
21 views

Magento 2: How to apply custom or dynamic TAX while entered VAT number is invalid for European countries?

I have tried to apply Tax for European country while customer entered invalid Vat Number but it's not working at all. Default Magento gives functionality for VAT validation and after that its change ...
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 ...
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 ...
0
votes
2answers
434 views

Magento 2 How to add country and state dropdown in admin form? [duplicate]

I need to add Country and State Dropdown in Magento 2 admin form. Please help me.
0
votes
1answer
747 views

Magento 2 How to add all country regions in database?

I checked directory_country_region in the database there is no region of the United Kingdom, I need all region of United Kingdom. Is Magento provide the sheet of all country regions or from where I ...
0
votes
1answer
90 views

magento 2: how to display region name in dropdown

Hi to all I added Italian region name in magento db by SQL in directory_country_region as follows: INSERT INTO directory_country_region(country_id, code, default_name) VALUES ('IT', 'TO', 'Torino'); ...
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
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 ...
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
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 ...
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'...
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
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
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/...
0
votes
0answers
74 views

How to redirect my website as country wise in magento2

Hello i have multiple store for my site,like us and uk when some one from US visit my site it will directly redirect to ex: www.demo.com/us store same for uk how to do in magento2
0
votes
2answers
1k views

How to get the country code based on country id in magento 2

I wish to get the country code based on country id in checkout page . I have the country id, How do i pass it to get country code in magento 2
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 ...
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 ...
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</...
0
votes
1answer
30 views

Mage 1.9.2.4 1: 1 website, 1 catalog, multiprice, multicurrency

I read many many answers. Many have similar questions, but at the end the solution seems to me to build many websites. My need: Magento 1.9.2.4 to implement 1 website (eg brand.com) with 1 catalog of ...
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 ...
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 ...
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 ...
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 ...