I you ever wondered how you can check if a Country, resp. a Country Code, is in the EU, i did the following:
Magento has a config value: eu_countries that lists all Countries of the EU.
You can find it in the backend under:
Configuration -> General -> Country Options.
Against this list you can validate your country code, f.e. that you got in an billing or shipping address of an order.
$address = $order->getBillingAddress()->getData(); $eu_countries = Mage::getStoreConfig('general/country/eu_countries'); $eu_countries_array = explode(',',$eu_countries); if(in_array($address['country_id'], $eu_countries_array)){ //do something useful: //for example show a tax hint like this german one: 'steuerfreie innergemeinschaftliche Lieferung' }
Pretty simple, once you know!
Do you know any other way?
Let me know!
Very useful, thanks!
Hello,
Just so you know you could also just use this:
Excellent!.
Both techniques worked for me, but I prefer the latest.
(Magento v18.0.0)
Cheers
Brilliant, thanks!
Hi,
How can I get European countries list in magento 2