05 September

Shipping Table Rates for foreign countries.

: 0 Comments
shipping

Configuring a shipping table () in #Magento for a foreign country can be tricky, but here you’ll find some very useful tips.

The mayor difficulty resides in configuring different shipping costs according to different provinces,  states, regions and postal codes. In this example, we’ll configure 2 shipping types (Shipping to branch and Home delivery), and the cost depends on each method, package weight and shipping distance.

We’ve used  WebShopApps MatrixRate extension in order to get more flexibility when configuring shipping table rates. This extension allows you to upload a .csv file with all the costs and shipping variables. However, you may find this error when trying to import this file:

Invalid Table Rates File Format
Invalid Country "Argentina" in the Row #3.

This error message is produced because Magento doesn’t have all provinces/regions/states of all countries in the database, so we have to add this values directly in the corresponding database table. So, navigate to your databse admin (for example phpmyadmin) then pass this values:

INSERT INTO
`directory_country_region` (`region_id`, `country_id` , `code`, `default_name`)
VALUES
('486' , 'AR', 'BA', 'Buenos Aires'),
('487' , 'AR', 'SA', 'Salta'),
('488' , 'AR', 'CA', 'Catamarca'),
('489' , 'AR', 'CH', 'Chaco'),
('490' , 'AR', 'UT', 'Chubut'),
('491' , 'AR', 'CO', 'Cordoba'),
('492' , 'AR', 'CT', 'Corrientes'),
('493' , 'AR', 'ER', 'Entre Rios'),
('494' , 'AR', 'FO', 'Formosa'),
('495' , 'AR', 'JU', 'Jujuy'),
('496' , 'AR', 'LP', 'La Pampa'),
('497' , 'AR', 'LR', 'La Rioja'),
('498' , 'AR', 'ME', 'Mendoza'),
('499' , 'AR', 'MI', 'Misiones'),
('500' , 'AR', 'NE', 'Neuquen'),
('501' , 'AR', 'RO', 'Rio Negro'),
('502' , 'AR', 'SJ', 'San Juan'),
('503' , 'AR', 'SL', 'San Luis'),
('504' , 'AR', 'SF', 'Santa Fe'),
('505' , 'AR', 'SE', 'Santiago del Estero'),
('506' , 'AR', 'TR', 'Tierra del Fuego'),
('507' , 'AR', 'TU', 'Tucuman'),

INSERT INTO
`directory_country_region_name` (`locale`, `region_id` , `name`)
VALUES
('en_US', '486', 'Buenos Aires'),
('en_US', '487', 'Salta'),
('en_US', '488', 'Catamarca'),
('en_US', '489', 'Chaco'),
('en_US', '490', 'Chubut'),
('en_US', '491', 'Cordoba'),
('en_US', '492', 'Corrientes'),
('en_US', '493', 'Entre Rios'),
('en_US', '494', 'Formosa'),
('en_US', '495', 'Jujuy'),
('en_US', '496', 'La Pampa'),
('en_US', '497', 'La Rioja'),
('en_US', '498', 'Mendoza'),
('en_US', '499', 'Misiones'),
('en_US', '500', 'Neuquen'),
('en_US', '501', 'Rio Negro'),
('en_US', '502', 'San Juan'),
('en_US', '503', 'San Luis'),
('en_US', '504', 'Santa Fe'),
('en_US', '505', 'Santiago del Estero'),
('en_US', '506', 'Tierra del Fuego'),
('en_US', '507', 'Tucuman');

 

This query will add the necessary values in your database in order to have set (in this example) the Argentinian provinces in your Magento installation. Changing the values can be very useful for any country. Then you must configure the Shipping Cost Table and its variables, here’s an example:

. País Región/Estado Ciudad Zip/Postal Code From Zip/Postal Code To Weight From Weight To Precio de envío Delivery Type
. AR BA * * * 0 100 51 Envio a domicilio
. AR BA * * * 100 300 55 Envio a domicilio
. AR SA * * * 0 100 55 Envio a domicilio
. AR SA * * * 100 300 61 Envio a domicilio
. AR CA * * * 0 100 55 Envio a domicilio
. AR CA * * * 100 300 61 Envio a domicilio
. AR CH * * * 0 100 51 Envio a domicilio
. AR CH * * * 100 300 55 Envio a domicilio
. AR UT * * * 0 100 55 Envio a domicilio
. AR UT * * * 100 300 61 Envio a domicilio
. AR CO * * * 0 100 51 Envio a domicilio
. AR CO * * * 100 300 55 Envio a domicilio
. AR CT * * * 0 100 51 Envio a domicilio
. AR CT * * * 100 300 55 Envio a domicilio
. AR ER * * * 0 100 51 Envio a domicilio
. AR ER * * * 100 300 55 Envio a domicilio
. AR FO * * * 0 100 55 Envio a domicilio
. AR FO * * * 100 300 61 Envio a domicilio
. AR JU * * * 0 100 55 Envio a domicilio
. AR JU * * * 100 300 61 Envio a domicilio
. AR LP * * * 0 100 55 Envio a domicilio
. AR LP * * * 100 300 61 Envio a domicilio
. AR LR * * * 0 100 55 Envio a domicilio
. AR LR * * * 100 300 61 Envio a domicilio
. AR ME * * * 0 100 55 Envio a domicilio
. AR ME * * * 100 300 61 Envio a domicilio
. AR MI * * * 0 100 55 Envio a domicilio
. AR MI * * * 100 300 61 Envio a domicilio
. AR NE * * * 0 100 55 Envio a domicilio
. AR NE * * * 100 300 61 Envio a domicilio
. AR RO * * * 0 100 55 Envio a domicilio
. AR RO * * * 100 300 61 Envio a domicilio
. AR SJ * * * 0 100 55 Envio a domicilio
. AR SJ * * * 100 300 61 Envio a domicilio
. AR SL * * * 0 100 55 Envio a domicilio
. AR SL * * * 100 300 61 Envio a domicilio
. AR SF * * * 0 100 51 Envio a domicilio
. AR SF * * * 100 300 55 Envio a domicilio
. AR SE * * * 0 100 51 Envio a domicilio
. AR SE * * * 100 300 55 Envio a domicilio
. AR TR * * * 0 100 55 Envio a domicilio
. AR TR * * * 100 300 61 Envio a domicilio
. AR TU * * * 0 100 55 Envio a domicilio
. AR TU * * * 100 300 61 Envio a domicilio
. AR BA * * * 0 100 31 Envio a Sucursal

In this case, we’ve configured:

Weight: packages between 0kg and 1kg have a cost and packages between 1kg and 3kg have a different cost.

Destination: provinces bordering the province of origin have a specific value.

Shipping type: home delivery and  shipping to Mailing branch.

Last thing, we must upload our shipping table rates .csv file to Magento. First you must have active Webshopapps Matrix rates extension in your default store-view, then select your Magento main website and you’ll be able to upload your own tables file. System/Configuration/Shipping Methods/Matrix Rates/Import/select file:

shipping

 

That’s it!.

Back to Top