Magento Country codes for table rate

I was getting mad trying to figure out how to know the Magentro Country Codes.

When you want to upload a Shipping Table Rate (csv file) you need to enter those codes in your file.

Looks like they don’t give the info in a easy way. Luckily, I’ve found a dirty solution that just works.

I went to the admin section and I got the code from one of those “Specific Countries” select input.

Here’s the list, enjoy 😉

2 and 3 letter relation

Maybe the 2 letters code is not working for you.

Here you have the 3 letter code:

108 comments
  • dear.
    i need your help
    I want added more information on checkout step
    that information about container loading.
    i like to show to customer or buyer
    when they do checkout and they can see how many loading container they have.
    in this case I have to information: 1 is 20 ft container and second is 40 ft container.

    calculation container base for volume product.
    example 1 chair length 12 cm high 12, tall 12 cm; volume is LxHxt

    we make sample our customer buy 10 product..and that volume total is

    0,9 % load contariner 20ft.

    can you help how i can show that information in checkout step?

    thk before
    im satya from indonesia.

  • I only have three kinds of shipping rate for countries according to regions — Netherlands, Europe, and rest of the world. Is there an easy way to set up the rates without inputting so many countries? Thank you.

  • Wow, thank you so much for the quick reply. I am a newbie of Magento. Parden me if I ask stupid questions. Does ESP refers to Europe? Really appreciate. You are very professional.

    • Hi Nicole.

      “ESP” was ment for SPAIN.

      When you import a table rate (CSV file) the default format is:

      “Country”,”Region/State”,”Zip/Postal Code”,”Weight (and above)”,”Shipping Price”

      You can use * it will take all from that field.

      US,*,*,0,3.000

      That means: for USA, all States, all Zip codes, from weight 0 will cost 3.

      If you have any other questions not from table rates, feel free to post them in our Forum

      Regards.

  • It really helps. Thank you! 🙂
    Does Magento allow my customers to choose courier?
    For example, my customers from the rest of the world have two courier choices: shipping fee €25 by TNT Express, and €50 by UPS. If not, I will only go for UPS.

    • Well you can test it.

      In the checkout process you can choose as many methods as you’re allowed to.

      If you have set UPS for all countries it will show it there.

      You have to set up in the “System -> Configuration -> Shipping Methods” the allowed countries 😉

      Regards

  • Hi quicoto,

    It took me a while to get my csv file work. I had to use three letter country codes, also I couldn’t use Excel to open my csv and edit.

    Your suggestion for using multiple methods is great. I solved my two-courier problem by enable Flat rate, since my rate for UPS is the same for countries outside Europe. I don’t need to enable UPS XML.

    Thank you again! 🙂

  • I tested again with two-letter country codes. It works. 😛

    I found that if the csv file was opened by Excel, it wouldn’t work anymore. Even I opened it with text editor later. It’s not the problem of country codes. Sorry for my misjudgment.

  • Look under the database tables directory_country etc.

    Happy Magento’ing

    Ed
    Jabez Networks, Inc.

  • Hi,

    This forum seems to be a great help, however I need to set up some rates for UK, Europe and Rest of World and I’m still a little confused about how I do this within Magento and this CSV file?

    Could you help me and paste a small example, as I’m worried I might have to go through and type every country code hundreds of times?

    Thanks
    Mark

    • Hi Mark,

      Do you mean for all UK / EU / World?

      It’s country based so you could add (UK):

      GB,*,*,0,3.000

      This will apply to all United Kingdom.

      If you want to apply the rest of the world:

      *,*,*,0,3.000

      And I’m afraid there is no fast way to apply all EU. I think you should list every country in EU.

      Let me know if that works.

      Regards.

      • Hi

        Thanks for the reply, is it best to upload it as a csv from excel as I’ve heard a few people have had problems? I’m a bit new to this kind of thing so not sure the best way to do it?

        Thanks

      • You can donload the generated CSV file and edit it with a text editor (notepad, Text Mate, Dreamweaver…) (Sometimes Excel breaks it, be carefull).

  • Hola,

    Creo que hablas español, te cuento que una persona me esta armando una tienda en magento y tenemos el problema del shipping, ya que mi pais (Peru) no tiene un modulo para este fin.
    El programador me dijo que podemos aplicar tu metodo.
    Pero aun no me queda claro como debo colocar los datos en el archivo de excel csv.
    Haber si me despejas las dudas:
    debe colocar en una columna todas las iniciales de los paises correcto?
    los de los asteriscos no me queda claro, necesito colocar los codigos zip? o solo coloco asteriscos?

    Saludos.

    • Hola joan,

      Debes colocar tan solo los paises que necesites.

      Los asteriscos significa “todo”. Es decir *,*,*,0,3.000 significa que aplica a todo el mundo.

      Espero que te sirva,

      Saludos.

  • Muchas gracias por la respuesta.
    Para redondear la idea, quedaría así:

    US,*,*,0,3.000
    PK,*,*,0,3.000
    etc
    etc

    Una consulta adicional, en mi pais los costos de envio se definen por rangos, es decir:

    Enviar a USA: 101 a 250 gramos – costo: $10
    Enviar a USA: 251 a 500 gramos – costo: $19

    y asi varia dependiendo del continente. Explicado esto para aplicarlo en tu csv quedaría así:

    US,*,*,101-250,$10
    US,*,*,251-500,$19
    etc
    etc

    Estoy en lo correcto?

    Saludos.

    • Hola joan,

      No. No debes poner simbolos. Solo números.

      La primera linea del CSV es así (y no debes romper el formato)

      “Country”,”Region/State”,”Zip/Postal Code”,”Weight (and above)”,”Shipping Price”

      Si te fijas, para poner rango de precios deberás usar varias reglas. De 0 a 5, de 5 a 10, etc…

      Un saludo.

  • Hola Quicoto,

    Ya me mareaste un poco.

    Cuando me dices que no debo pober simbolos te refieres que no debo poner el signo $$ correcto?
    Luego cuando me dices el rango de precios “poner varias reglas” eso no me quedo claro, me puedes explicar un poco ese tema.

    Por el momento estaria quedando asi:

    US,*,*,101-250,10
    US,*,*,251-500,19
    Estoy bien o mal?

    Muchas gracias por tu apoyo.

    Saludos.

    • No puedes poner “101-250”

      Tiene que ser:

      Hasta 101 = US,*,*,101,10
      A partir de 250 = US,*,*,250,19

      También puedes ir probando de subir el archivo CSV si está mal te saldrá el aviso 🙂

      Saludos

  • Ok, ya me esta quedando mas claro el asunto.
    Ahora te comento para que te des una idea, mi tienda va a vender ropa, en la cual me voy a posicionar en la venta de polos o t-shirt.
    Entonces yo voy a pesar cada prenda por ejemplo la prenda de la marca “A” talla S, tiene un peso de 140 gramos.
    Como encajaria este peso dentro de los parametros que ya hemos visto:
    US,*,*,101,10 ??

    Saludos.

    • En este caso, si solo tuvieras la linea:

      US,*,*,101,10

      Por el peso de 140 saldría 10.

      El peso es “peso (o superior)” quiere decir que tendría que tener una regla tipo:

      US,*,*,0.1,10

      Que aplicaría a todos los productos entre 0.1 y 101.

      Saludos.

  • Gracias quicoto, bueno me queda mas que nada comenzar a armar el csv con todos los paises y cada uno con sus rangos de peso, me va a llevar un buen tiempo.

    Saludos y muchas gracias por tu ayuda.

  • hi , i am a magento owner from New Zealand . i want to set up different shipping fees according to different regions , such as Northland , Southland and so on . Could you please tell me how i can do that ? can it be finished by the table rates , or some other magento extensions must be used ? i am appreciate that you can help me . thank you very much .

  • Thank you , Rick . but now another problem occured . It seems to be that only two letters can input in the region . for example , i want to set up the shipping fees for Auckland in New Zealand , i failed because AKL is short for Auckland ,but only two letter can be input in the region in the csv.Could you help me ?

  • Rick , Thank you for your help . i have installed that extension before, but i can’t find the information about how to set up and use this extension .If you know something about that , i will very appreciate for your help. thank you very much !

  • Thank you so much . You are so nice to help me .

  • Thank you all guys! Just reading through your comments helped me a lot 🙂 This lack of documentation on magento website it’s a real pain in the ass..

  • For international shipping –

    Is there a code for ALL countries? Can you just write ‘A?LL’ -or- do you have to list each country individually?

  • Another question:

    What text editor do you use to edit the csv file?

    • You should NOT use any kind of “Microsoft Excel”.

      To avoid problems use a plain editor like textmate (mac) or notepad (windows. Not sure if it works though). Also… dreamweaver can do the trick.

      Regards

  • Great thanks!

    So for an international shipment available to ALL countries, I should use this:

    *,*,*,0.1,10

    Is that correct?

  • Thanks Rick! I appreciate you answering so promptly!

    I will certainly let you know.

    By the way – Great site! Nicely put together.. This is truly a valuable resource.

  • Hi,

    I have a little problem with Magento. I want to offer the same standard shipping rate throughout the UK but anyone with a Channel Islands postcode is charged international shipping rate. How do I go about making sure this doesn’t happen?

    Thanks

  • Hi, i have been reading this site, and think its very informative! great work guys.

    i am new to all this, so please fogive me if i ask stupid things.

    Ok, so i want to know if i can set a price for shipping per gram. 1 gram = $0.23.

    so for example: item1 = 200grams. using my csv file it will automaticly calculate that $0.23 X 200 = $46

    if had item1 (200gram) item2 (900grams) and so on, it would just add it all up…

    OR do i have to set shipping weight for EACH item weight i have listed in my website..

    Obviously hassle for Combined shipping items.

    Thanx for your help, and appologies for any stupiduty on my part!!

    • Hi Paul,

      The only way I know is setting weight ranges.

      “Country”,”Region/State”,”Zip/Postal Code”,”Weight (and above)”,”Shipping Price”

      If you scroll up you can see a couple of examples.

      Let me know if this helps,

      Regards.

  • ooops forgot…!

    also wanted to have weight ranges, so anything from 1gram up to 500grams, would cost $0.13 per gram.

    and 510grams up to 700grams would cost $0.09 per grams…

    And so on…

    Please help..

  • Hi,

    My csv is working poperly, but when i added region/state i got an error. i want to put some state of my country(India). So, how should i put the name of the region/state of India.

  • so, i have solved all this, and even now have multiple shipping options per weight.. thanx guys.

    But i now have a new, and maybe bigger problem.

    Ok, so i have paypal set up for checkouts., it calculates product price plus shipping and charges to that fact,

    BUT if i use Paypal Express checkout, it only charges the product cost, and does not add shipping…

    Anything to do about this?

  • Hi,
    I am a new user to magento, Plz Help,
    I want to upload Shipping table rates for different States of India.
    How can I do so?

    Regards

    • Hi there,

      You need to create a CSV file with the following structure:

      “Country”,”Region/State”,”Zip/Postal Code”,”Weight (and above)”,”Shipping Price”

      You can define the States in the second parameter.

      Example: US,*,*,101,10

      * means everything.

      Let me know if this helps,

      Cheers.

  • Can You plz help, how can change the flate for canada as $30 instead of $23.25 for “Priority Mail International $23.25”

  • Hi Rick,
    I have tried all these options, once and separately too.
    The system does not recognize India states and Postal Codes.
    Is there any extension which I need to install for India?

    Help!

    Regards

  • HI RICK,

    I dint get the solution still, i am waiting for replay..!!

    • Hi siddesh,

      I’m afraid you’ll have to figure it out

      Please follow this structure:

      “Country”,”Region/State”,”Zip/Postal Code”,”Weight (and above)”,”Shipping Price”

      Example: US,*,*,101,10

      * means everything

  • Hi Rick,
    Thanks for the concern, I will surely update ASA i get any details.

    Regards

  • Hola Rick una consulta fácil, puedo poner varios países juntos en una misma línea??

    BGR;CYP;SVK;SVN;EST;HUN;LVA;LTU;MLT;POL;CZE;ROU * * 100 3540
    GIB;LIE;MAR;NOR;SMR;CHE * * 0 23.02
    GIB;LIE;MAR;NOR;SMR;CHE * * 0.5 28.85
    GIB;LIE;MAR;NOR;SMR;CHE * * 1 34.82
    GIB;LIE;MAR;NOR;SMR;CHE * * 1.5 40.79
    GIB;LIE;MAR;NOR;SMR;CHE * * 2 46.76
    GIB;LIE;MAR;NOR;SMR;CHE * * 2.5 51.88
    GIB;LIE;MAR;NOR;SMR;CHE * * 3 57.01
    GIB;LIE;MAR;NOR;SMR;CHE * * 3.5 62.13
    GIB;LIE;MAR;NOR;SMR;CHE * * 4 67.25
    GIB;LIE;MAR;NOR;SMR;CHE * * 4.5 72.37
    GIB;LIE;MAR;NOR;SMR;CHE * * 5 74.66
    GIB;LIE;MAR;NOR;SMR;CHE * * 5.5 76.95
    GIB;LIE;MAR;NOR;SMR;CHE * * 6 79.24
    GIB;LIE;MAR;NOR;SMR;CHE * * 6.5 81.53

    de ser positiva la respuesta
    cual sería el símbolo que separa a los países para que no de error?
    el listado de precios es muy largo como para repetirlo país por país

    Saludos y muchísimas gracias por la colaboración

  • Hi Rick,

    I am setting up table rates on a mac and I don’t have textmate. However I do have dreamweaver where I entered the parameters for my shipping. when I upload the html file into magneto i receive the message that its an invalid file format. do i have to do a further conversion of the html file back into a csv, if so how do i go about this as I can’t see this option in DW.

    Thank you

    • Hi Caroline,

      Dreamweaver is fine, you should be able to do it.

      When you go to “File > Save As” you should see a “file type”. Select (if I’m not mistaken) the last one which is something like “All files”.

      Then just type .csv after your desired file name.

      Let me know if this helps.

  • Hi Rick,

    Thanks, i managed to create the table rate and am able to save the config in magneto where before i was getting an error messages. However none of my delivery settings are showing in the shopping basket, so I cant say for sure if the system has processed my rates. I will spend some time on this and let you know of the outcome.

    Caroline

  • hello there,

    My client want to set the shipping and handling charges at 10% of selling price. How will I do that?

  • Hi Rick,

    I have created my cdv file (firstly in Excel Mac 2011), which allowed me to save as either:
    Comma Seperated Values (.csv)
    Windows Comma Separated (.csv)
    MS-DOS Comma Separated (.csv)

    All of which did not work.

    I then tried saving using programs such as TextEdit, TexWrangler with the following settings:
    Line Breaks:Unix (LF)
    Encoding: Unicode (UTF-8)

    Again none of these worked.
    Also, I am trying for EU shipping only. All EU contries have been added to by csv file.
    I have then tried allowing specified countries (then selected all EU Contries).

    Every time I upload and save config, nothing changes at all. All countries show from dropdown, but only GBP will work as on the previous csv file.. Its as if its not recognising anything i do.

    I have also disabled the ‘Compiler’ to see if this was effecting it, no luck.

    I just have a horrid feeling that Excel has ruined my csv file (i have tried copying and pasting all text into other programs and resaving to try and create new, no luck)

    Or could it be that something within my setup is disabling me to make any changes to the shipping methods?

    I know you have answered hundreds of questions, and i just hope im not to late!! Thanks for all your help with previous posts so far!

    Thanks again,
    Will Halls

    • Ignore the first line mistake, i meant csv but my iMac loves to auto-correct!

      *also, tried multiple browsers, refreshing index, cache etc through Magento and still no luck*

    • This is a tough one Will.

      If the CSV does not return any error when uploading it means the format is fine. The problem must be in the rules.

      Could you please try to add a single line such as:

      (change the values if needed)

      Then try to checkout a product to see if it works.

      Cheers.

  • Sorry, I am not the most computer literate when it comes to codes etc.

    So make a csv file with one line as shown in your post? Upload and see if it works..
    My csv starts with this:

    Country,Region/State,Zip/Postal Code,Weight (and above),Shipping Price
    GBR,*,*,1,1.5
    GBR,*,*,2,4.41
    GBR,*,*,4,7.62
    GBR,*,*,6,10.34
    GBR,*,*,8,12.67
    GBR,*,*,15,13.61
    GBR,*,*,20,15.86
    ALB,*,*,1,36.23
    ALB,*,*,2,44.98
    ALB,*,*,4,55.43
    ALB,*,*,6,62.32

    etc etc..

    So I shall make a new csv, just with:

    Country,Region/State,Zip/Postal Code,Weight (and above),Shipping Price
    GBR,*,*,1,1.5

    and see if its works?

    Thanks for the unbelievably fast response!!

    Will

  • Still no luck after creating a new csv with only the first few lines…

    Its as if magento is completely ignoring anything i change within the shipping area..

    Thanks,
    Will

  • Once uploaded, no change. I still get ‘Sorry, no quotes are available for this order at this time.’

    Also, I have tried enabling and disabling all of the tick boxes next to every option, which usually are all ticked to ‘use default’. No luck.

    So, we know its not the csv now then at least!

    Any other thoughts?

    Thank you Rick, really appreciate your time!

    • What about the weight?

      Does your product have weight? I think it’s a mandatory field for the shipping rates to work.

      At this point I’m guessing the problem it’s some configuration.

  • Yes all products have weights.

    The shipping on the website currently works fine for the UK, as my web designer set up.

    It just seems that anything I do, or changes i try with the shipping options, do not apply. I shall get in touch with my designer again, to see if he can shed any light on it, as he configured it. I know he played with cache management and the Compiler options to speed the website up, so i wonder if that could be something to do with it…

    Thank you for your time, and if there is anything else you can think of then i would be immensely grateful!

    Thanks,
    Will

    • Oh My …. 🙂

      It has to be the cache. You have to flush it every time you change something like that.

      If not, maybe your designer hardcoded something or installed an extension to override the shipping table (could be posible).

      Cheers,

  • Configuration, Layouts and Blocks HTML output are all enabled, the rest are disabled.

    Reflushed cache, no luck.

    Whats weird is even though i set ‘specified countries’ and select them, every time i go to select a country in the front end, the entire list comes up, showing that whatever i am saving, it is not applying!

    Im starting to think that can be the only option, that he has hardcoded something into the site, blocking any updates within this area….

    Thanks again Rick.

    Will

  • Sorted this by simply installing MatrixRates by WebShopApps (http://www.webshopapps.com/uk/matrixrate-shipping-extension.html) for anyone who was interested. Must have been an issue with the standard shipping setup on my site.

    Big thanks to Rick for all your help though buddy!

  • Hola quicoto

    Tengo un problema con el table rates que no se identificar.

    Lo configuro y me funciona, pero transcurridas unas horas (normalmente por la noche, soy d e España) se me desconfigura y ya no me calcula bien.

    Lo tengo del siguiente modo:
    De 0 a 60 -> 6€
    y a partir de 60 GRATIS.

    Lo subo y me funciona bien: 70 € gratis.

    Pero de repente,…. deja de calcular el gratis, y no se por que… si lo vuelvo a subir me lo hace bien…

  • This is a geat help thanks – I would how ever only need the following;
    Ireland;
    United Kingdom;
    Europe
    Rest of world
    what would the codes be for the above?
    Regards
    Richard

  • Hi,

    I want to use below syntax.

    Country,Region/State,Zip/Postal Code,Weight (and above),Shipping Price
    IND,*,1100*,500,199

    Would it be possible ?

    I have many zips which has starting 110001, 110002 and etc…

    Please help me …

  • Postcode ranges don’t seem to work in Magento. Is this correct? In tablerates csv I have tested to no avail:

    35*
    01000-06999
    “37999,39000”

  • Hi,

    Is there any method to set different shipping rate for different region of China?

    • Sure, you just need the region codes (postal codes?) 🙂

      • Thanks your help.
        I got another problem with shopping cart.
        When “edit” a product in shopping cart, I will be bring back to product page, and after I “update cart”, there is one more product in shopping cart.
        Is there a method to fix it to keep only the updated product in the cart?

      • As I understand the only way to edit the product quantity is from the cart itself. You shouldn’t have to redirect the user to the detail page. By doing so they will click on “add to cart” that will add a new item to the cart.

        Cheers.

  • Got it, thanks.
    Another problem. After setup Paypal, “Unable to process payment. Please contact the merchant as the shipping address provided by the merchant is invalid, and the merchant has requested that your order must be shipped to that address.” message popup when checkout with China shipping address using Paypal payment, . Please advise how to fix it.

  • Hola Rick,

    De antemano te agradesco toda la ayuda que me puedas brindar.
    El Problema que tengo en estos momentos es que ocupo que cuando una compra sobrepase el maximo (que es de 27 kilos) de peso que enviamos el cliente vea un mensaje, (EJEMPLO: si un cliente compra un refrigerador que obviamente va a pesar mas de 27 kilos le de al cliente este mensaje (Retiro en bodega. Costos de envío no incluídos).

    Gracias

    • Hola,

      No parece que sea algo que puedas hacer desde el admin, ni tampoco que sea fácil. Dependiendo de en que punto del proceso de compra quieres que salga el mensaje tendrás que editar unos ficheros u otros. Además esos ficheros dependerán exclusivamente de la plantilla que uses.
      Activando los path hints (How to Turn on Magento Path Hints) te va a dar una idea de lo que tienes que tocar. Una vez ahí tendrás que intentar recuperar el peso total de la cesta (o del item) y mostrar o no un mensaje

      Antes de hacer todo esto te recomendaría que buscaras alguna extensión, igual ya existe alguna similar.

      Un saludo!

      • Hola Rick,

        Te cuento que despues de ir y venir varias veces he logrado hacer lo que te dije. Use una extencion que se llama Multiple Table Rates Extension y usando un programa que se llama CSVed que es especial para editar .csv lo haces. Lo mejor de todo es que lo haces todo desde el admin.

        Saludos desde Costa Rica.

  • Hi Rick,

    Thank you for this and typically I have noticed the Country likes the 3 digit and Region/State likes 2 digit codes.

    Anyways on to my question: I am trying to set up shipping to Hong Kong since we have been shipping a lot of our product to Hong Kong recently via FedEx International Economy. So I tried setting up Hong Kong to only ship via FedEx International Economy but when I do, I get nothing. I tried using the 2 digit and 3 digit code but still nothing. I am not even receiving the error stating “No quotes are available at this time”. It just reloads the page and nothing changes.

    My take on this problem is: I have a feeling it has something to do with the way Magento has Hong Kong set up as Hong Kong SAR China. I am thinking FedEx is not recognizing this as a country and in return has no idea what to do? So I was looking for hopefully a way to change “Hong Kong SAR China” to simply “Hong Kong”? Or will this affect other things?

    Thanks in advance.

  • hi
    i wanted the region codes for countries like greece, spain and italy
    but i am unable to find it please help.

  • Thanks for sharing the info and thanks for replying to everyone’s questions. I am new to Magento and I am trying to set-up my site. I feel it is going to take me a while to set-up my shipping fees for each country.

  • Thanks for sharing the info and thanks for replying to everyone’s questions. I am new to Magento and I am trying to set-up my site. I feel it is going to take me a while to set-up my shipping fees for each country.

  • BUT WORKS PERFECTLY !!! AND ONLY NEED 10 MINUTES !

  • hi,
    i need to get region/state code for dammam, riyadh and jeddah in saudi arabia.
    pls help, i’am in hurry.

  • hi,
    do you know why in database, country code is 2 characters but 3 in csv file?

  • Hi Rick,
    Where can i get region/state code for India ?

  • I simply wanted to construct a simple note so as to appreciate you for all the lovely ways you are posting on this site. My long internet search has at the end of the day been compensated with reliable points to share with my best friends. I ‘d tell you that most of us website visitors actually are unequivocally lucky to be in a good community with many special individuals with very helpful principles. I feel extremely blessed to have discovered your web site and look forward to some more fabulous minutes reading here. Thank you once again for everything.

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*