10 votes
Accepted

Remove country form payment block

Not 100% sure about this one, but I think the address in the dropdown is formatted via an admin settings. You can go to Stores->Configuration->Customer->Customer Configuration->Address ...
Marius's user avatar
  • 198k
9 votes
Accepted

Limit country drop down input field Magento 2

Please allow only that need from Admin > Stores > Configuration > General > Country Options > Allow Countries
Bhavin iFlair's user avatar
8 votes
Accepted

magento 2 : Get country from IP address

Use below code: protected $logger; protected $objectManager; protected $_curl; public function __construct( \Psr\Log\LoggerInterface $logger, \Magento\Framework\...
Prashant Valanda's user avatar
7 votes

How to get Country ID from Country Name in Magento1.9.2.4?

The country names don't come from the database. They come from the ZF data xmls. You can see what this returns: Mage::app()->getLocale()->getCountryTranslationList(); Not sure about it, ...
Marius's user avatar
  • 198k
6 votes

How to get selected Allowed country list in Magento 2..?

You can fetch the Allowed Countries List using the below Code: public function __construct( /* Add below dependencies */ \Magento\Directory\Model\AllowedCountries $allowedCountryModel ) { ...
Pankaj Pareek's user avatar
5 votes
Accepted

Restrict Cash on delivery based on Country under shipping method

Here's how to allow the COD payment method for only specified countries: Go to system -> configuration -> Payment Methods Expand the section "Cash on Delivery Payment Change "Payment from Applicable ...
Mitch Goldman - londonmitch's user avatar
5 votes
Accepted

Magento 2 Country Name not get translated when using countryFactory

Use locale code as param in getName <?php public function __construct( \Magento\Directory\Model\CountryFactory $countryFactory ) { $this->countryFactory = $countryFactory; } public ...
Ranganathan's user avatar
  • 3,210
5 votes
Accepted

How to get country dial code for telephone number in Magento 2?

You can create function in helper by enter all dial number with country code. I have created function like below: public function getphonecode($code) { $countrycode = array( 'AD'=>'376'...
Surinder Kaur's user avatar
4 votes

Change country name in magento 2.2

The country labels loaded using ICU. You can find more info in the Magento\Framework\Locale\Bundle\DataBundle class. Data is loading in the get method: /** * Get resource bundle for the locale * * ...
Siarhey Uchukhlebau's user avatar
4 votes

Programmatically Export Sales order customer details to excel format

Finally i got solution. This is my final code: <?php require_once("app/Mage.php"); Mage::app(); Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID); $orders = Mage::...
sathya's user avatar
  • 421
3 votes

Programmatically Export Sales order customer details to excel format

Instead of : $order->getBillingAddress()->getCountryId() you can do Mage::getModel('directory/country')->loadByCode($order->getBillingAddress()->getCountryId())->getName()
Raphael at Digital Pianism's user avatar
3 votes

Ship to certain countries but allow any country in billing address

It is not possible by default to separate visible countries for delivery from a billing address. But it is possible for Magento to set specific shipping method restrictions. It means that if a person ...
Ivan Chepurnyi's user avatar
3 votes

Limit Orders to a specific country

A common solution is shipping restriction by postcode. Here is another question on the topic: Only allow order for specific post codes in a specific country? Basically one option is to use the table ...
Fabian Schmengler's user avatar
3 votes
Accepted

Magento 2.3.3: Creating customer address in admin shows no countries or wrong countries in dropdown

There is a bug in magento 2.3.3. You need to edit admin layout More information here.
kpitn's user avatar
  • 46
2 votes

xml of config is incomplete (countries not shown)

Please goto Current Configuration Scope: Select Default Store View Now in General - > Countries Options Select Default Country -> <select your country> Allow Country -&...
Upendrasinh Jadeja's user avatar
2 votes
Accepted

Restrict products by override the function isSalable()

No need to override for this, if you take a look at Mage_Catalog_Model_Product::isSalable() you have two observers to make action on is_salable attribute : /** * Check is product ...
Matthéo Geoffray's user avatar
2 votes
Accepted

How to get Country ID from Country Name in Magento1.9.2.4?

You can use below code for that $countryName = 'your country name'; $countryId = ''; $countryCollection = Mage::getModel('directory/country')->getCollection(); foreach ($countryCollection as $...
Murtuza Zabuawala's user avatar
2 votes

How to remove countries from Magento 2 drop down list?

You can achieve this from admin panel. There is no need of writing any code. Go to Admin Panel : Stores->Configuration->Sales->tax->Default Tax Destination Calculation. There you can select ...
Akash Raj's user avatar
2 votes

How to get selected Allowed country list in Magento 2..?

You can utilise the getCountryCollection method in Magento's Directory Helper as it filters the returned collection to contain allowed countries only. Example: use Magento\Directory\Helper\Data as ...
Tom Birch's user avatar
2 votes

Magento 2: How to change country name?

Because of the changes in 2.4 being applied in the core translation file app/code/Magento/Config/i18n/en_US.csv We can override it at the theme level. Create a custom translation CSV file here app/...
asherrard's user avatar
  • 216
2 votes
Accepted

sql query for shipping countries from my sales order

From this query you can get countries of shipped orders SELECT o.increment_id, oa.country_id FROM sales_order o INNER JOIN sales_order_address oa ON o.entity_id=oa.parent_id INNER JOIN sales_shipment ...
Shoaib Munir's user avatar
  • 9,284
1 vote
Accepted

SOLVED: Tax zones limitation -> Puerto Rico

Do not use "PR" country code: it is no longer legit since USA annexed it in the late 2017.
1 vote

Change country name in magento 2.2

I followed the below link and it helps me to add a new country Add new nation into nation's list in Magento 2.3.5
Kushal Dani's user avatar
  • 2,064
1 vote

Magento2 VAT id required for specific countries

This can be enabled via admin panel: Stores > Configuration > Customer Configuration > Name and Address Options > Show Tax/VAT Number The possible options are: No Optional Required On ...
Aditya Shah's user avatar
  • 7,517
1 vote

Limit country drop down input field Magento 2

You can set country drop down option from Admin >> Store >> Configuration >> General >> General >> Country Options. Default Country : Selected country will display as default country in drop ...
Suresh Chikani's user avatar
1 vote
Accepted

Get customer billing address country short code (ISO Code)

You can try this: $session = Mage::getSingleton('customer/session'); if ($session->isLoggedIn()) { $countryCode = $session->getCustomer()->getDefaultBillingAddress()->getCountry(); }
sv3n's user avatar
  • 11.6k
1 vote

Convert the currency format to USD for the purchases outside India

You can do this by doing some customization in index.php file you can set default currency before Mage::run() for that you have to add this code before Mage::run($mageRunCode, $mageRunType); $...
Emipro Technologies Pvt. Ltd.'s user avatar
1 vote

Restrict Place Order if Shipping Country is USA

Check this article: http://inchoo.net/magento/sorry-we-cant-ship-there/ Also there is some paid modules, that offer this functionality.
Nikola's user avatar
  • 460
1 vote

Magento get Zipcodes for a particular country and state

Default magento does have this feature.You need to do customization for your requirement. First create a custom module which have a custom table and custom model. At table,you need to save country id,...
Amit Bera's user avatar
  • 77k
1 vote

xml of config is incomplete (countries not shown)

Just clean core_config_data table for that path something like: delete from core_config_data where path = 'general/country/allow'; then obviously, flush cache. If problem persists you may take a look ...
MauroNigrele's user avatar
  • 3,005

Only top scored, non community-wiki answers of a minimum length are eligible