Skip to content Skip to sidebar Skip to footer
Reading Time: 3 minutes

Are you using magento store? You want to add shipping rates for the items based on the zip code/postal code ? Then you’re in the right place. Here I’m going to show how to add shipping rates based on user selected country.
I imagine you in your store, user will enter the zip code manually. Also you can auto populate the zip code after user selected the city in drop down box for your country.I’ll explain this method in my next post.
Let’s start.

Here the main advantage is you dont need to add fee for each zip code in Table rate settings.

1-Install Owebia Shipping Free Extension.

1-Go to the following page and download this free extension and install correctly. Please install via manually by placing each files/folders.
Download Owebia Shipping Free Extension

2-After install clear the magento all cache. Then logout and login into magento admin panel.

3-Make sure the extension is enable from configuration settings.

2-Configure the Extension.

1-Go to System -> Configuration -> Owebia -> Owebia Shipping2

2-Save the settings as following image.
Owebia-Shipping settings

3-Go to System -> Configuration -> Sales -> Shipping Methods
Under “Owebia Shipping – Mode de livraison 1”. You can add the rules and conditions.

Owebia Shipping Rules and Conditions

-Please enable and put the title there.
-Leave the other settings as it is.
-Add the following contents into configuration box.
Owebia-Shipping formula with settings

{ 
    "id_a": { 
        "label": "Zone A", 
        "shipto": "LK(00*)", 
        "fees": 100 
    }, 
    
    "id_b": { 
        "label": "Zone B", 
        "shipto": "LK(10*,11*)", 
        "fees": 200 
    }, 
        
    "id_c": { 
        "label": "Zone C", 
        "shipto": "LK(12*,20*,32*,60*,71*,80*)", 
        "fees": 300 
    }, 
            
    "id_d": { 
        "label": "Zone D", 
        "shipto": "LK(21*,31*,43*,50*,51*,61*,70, 81*,90*)", 
        "fees": 400 
    }, 
                
    "id_e": { 
        "label": "Zone E", 
        "shipto": "LK(22*,30*,40*,41*,42*,82*,91*)", 
        "fees": 500 
    } 
}

 

Explanations

"id_a": {
    "label": "Zone A",
    "shipto": "LK(00*)",
    "fees": 100
}

 

Here, lable will be display in the shipping rate area after input the zip code.
shipto means the zip code zone. For a example zip code begin with 00. These user type 00600 zip code the above condition rate 100 will be applied. But if enter 12345. Then rule will be “Zone C”. Hope you understand. Like this way to others too.
Note :- add correctly zip code to rules.
More details:- http://www.owebia.com/os2/en/doc

Owebia Shipping Rules and Conditions per weight of items

Think if you user add 5 items. Each item weight is 10kg. So total weight is 10×5=> 50kg.
The you have to add delivery charges per kg. How can you do this? Here is the solution.
I’ll explain my conditions first to clear this for you.

Zone First KG Each add 1KG
A 100.00 50.00
B 200.00 70.00
C 300.00 125.00
D 400.00 150.00
E 500.00 200.00

If user ordered total 5kg and it’s zip code is 00600 (It’s belong to Zone A).
Then charges will be as follows.
Normal Delivery charges:- 100 (LKR is my currency- Sri Lanka)
Now remaining weight:- 50-1 => 49kg (Because of we have already changed 100LKR above. NOT 100×5=>500 LKR).
Delivery fee for 49kg:- 49 x 50 => 2450 LKR (Here 50 LKR means fee for additional 1kg in Zone A).
TOTAL SHIPPING FEE => 100 + 2450 => 2550 LKR.
Hope you understand and clear. If not clear leave a comment below. I’ll explain.
Note:- only apply the weight fee if item weight is more than 1kg.
Let’s add the Rules and condition (Formula) for above fee.

{ 
    "id_a": { 
        "label": "Zone A", 
        "shipto": "LK(00*)", 
        "fees": "{cart.weight}>1 ? 100+({cart.weight}-1)*50 : 100" 
    }, 
                
    "id_b": { 
        "label": "Zone B", 
        "shipto": "LK(10*,11*)", 
        "fees": "{cart.weight}>1 ? 100+({cart.weight}-1)*70 : 200" 
    }, 
                    
    "id_c": { 
        "label": "Zone C", 
        "shipto": "LK(12*,20*,32*,60*,71*,80*)", 
        "fees": "{cart.weight}>1 ? 150+({cart.weight}-1)*125 : 300" 
    }, 
                    
    "id_d": { 
        "label": "Zone D", 
        "shipto": "LK(21*,31*,43*,50*,51*,61*,70, 81*,90*)", 
        "fees": "{cart.weight}>1 ? 200+({cart.weight}-1)*150 : 400" 
    }, 
                        
    "id_e": { 
        "label": "Zone E", 
        "shipto": "LK(22*,30*,40*,41*,42*,82*,91*)", 
        "fees": "{cart.weight}>1 ? 400+({cart.weight}-1)*200 : 500" 
    } 
}

 

References
https://en.store.owebia.com/magento1-module-shipping-free.html
http://www.owebia.com/os2/en/doc