Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Magento - How to add zone based shipping
Old 03-03-2011, 01:35 AM Magento - How to add zone based shipping
TWD
TWD's Avatar
King Spam Talker

Posts: 1,190
Trades: 0
Something I learned which I thought I might as well share with the Universe.

If you want to create different shipping costs for different parts of a country,
the Magento option you need to set up is called "Table Rate Shipping" in
the Configuration area, under Shipping Methods.

There is a article in the Magento Knowledge Base which describes most of it pretty well here:

http://www.magentocommerce.com/knowl...rate-shipping/

In a nutshell, you can export as CSV, enter your new values, then import it and save the configuration.

HOWEVER

The default countries/regions in the database are only the USA and its 50 states plus what looks like a bunch of other random crap.

If you try to upload your CSV file with any other country/region combinations, you'll get Magento spitting a bunch of rude red reject
messages.

So if you want to create Table Rate Shipping for any other country, you are going to have to roll up the sleeves,
crack open the Magento database with myPHPadmin, and manually insert some records.

There are only two tables you need to worry about

directory_country_region
directory_country_region_name

directory_country_region has 4 fields
* region_id (the next incremental record number in the table)
* country_id (it should be a 2 letter code, eg if your locale is ja_JP, the code you want to use is the second part "JP")
* code (this can be anything you like and should be a unique identifier for the state, province, region whatever. It's not viewable by the end user)
* default_name ( The actual name of the state, region etc for example "Okinawa")

directory_country_region_name has 3 fields
* locale (en_US, or ja_JP etc, NOTE: I just used the en_US locale because I didnt need translated location names.
Didn't research how to add different translations of place names but you might be able to do it through the translation CSV files [not to be confused with the Table Shipping CSV files])
* region_id (must match the field in the other table, above)
* name (same as the field in the table above. Not sure which table is actually drawn upon for the user display)

So enter your new country/region combinations in these fields.

DONT forget to flush the system cache through the site Admin panel.

THEN you can upload your Table Rate CSV file and you should get a happy green success message.


That's it!
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE

Last edited by TWD; 03-03-2011 at 06:10 AM..
TWD is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-03-2011, 10:38 PM Re: Magento - How to add zone based shipping
TWD
TWD's Avatar
King Spam Talker

Posts: 1,190
Trades: 0
BTW

I found a site that lists all the two letter country codes in Magento

http://php.quicoto.com/magento-count...or-table-rate/
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE
TWD is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Magento - How to add zone based shipping
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10629 seconds with 12 queries