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 ...
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
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\...
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, ...
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
) {
...
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 ...
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 ...
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'...
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
*
* ...
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::...
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()
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 ...
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 ...
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.
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 -&...
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 ...
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 $...
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 ...
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 ...
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/...
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 ...
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.
Community wiki
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
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 ...
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 ...
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();
}
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);
$...
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.
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,...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
countries × 66magento2 × 20
magento-1.9 × 15
shipping × 10
checkout × 8
country-regions × 7
shipping-address × 5
billing-address × 5
magento-2.1 × 4
magento-1.7 × 4
configuration × 4
currency × 4
magento2.3 × 3
shipping-methods × 3
customer-address × 3
magento-1.8 × 2
admin × 2
magento2.2 × 2
orders × 2
cart × 2
onepage-checkout × 2
store-view × 2
magento2.3.3 × 2
multicurrency × 2
drop-downs × 2