Skip to main content
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
10 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

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,220
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
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
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
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
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
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
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
  • 226
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,482
1 vote

Magento 2 Country Restriction on checkout page shipping address

app/code/Vendor/Checkout/Plugin/Block/DirectoryDataProcessor Override DirectoryDataProcessor to add a new directory for the shipping step country_id component: <?php namespace Vendor\Checkout\...
Yanci Nerio's user avatar
1 vote
Accepted

Magento2: How to get country list in custom HTML template

With reference to this answer. Magento already provide some inbuilt solution for this. <?php $countryBlock = $block->getLayout()->createBlock('Magento\Directory\Block\Data');?> <?= $...
Mayur Sisodiya's user avatar
1 vote
Accepted

Magento 2 Allowed Countries Admin Issue

Please open the below path file. vendor/magento/module-customer/view/adminhtml/ui_component open customer_address_form.xml and remove below code from line number.194 <formElements&...
Nikul's user avatar
  • 1,306
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

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,627
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.7k
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

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