# Calculate shipping cost by weight in Drupal commerce

I've set up a commerce website and I'm trying to calculate the shipping rate.

I have 2 shipping rates: a standard rate and a secure rate. Now I need to increment the price of both these rates by 2 euros if the weight of the total order is over 2 kg's (or 2000 grams since the weight is shown in grams).

I followed Randy Fay's tutorial: http://vimeo.com/33838479 but he multiplies the cost by an amount and this is not what I need.

Another related question (calculate shipping by weight) is a little closer but I do not need a cost per pound.

I've tried to create rules to achieve this, but I really don't know how to do any of this.

I also added this patch in an attempt to get things working properly.

Right now, I can't figure out how all the pieces fit together, I'm sure I have everything I need but I could use some help putting everything together. Can someone guide me in the right direction?

For Commerce shipping 2.x this is actually pretty simple.

1. Create a calculation rule.
2. Set the condition that the weight for the order is above 2 kg (this can be a bit tricky to do in Rules, but there a plenty of guides how to do it. I believe Randy even shows this in the video you linked to.
3. Select the "add amount to unit price" for a line item and select the shipping line item. You can even select which component to use for this and could create an weight fee price component if you wanted to.

That's it.

• Thanks @googletorp that really helped me out. Now when I select the "add amount to unit price" I need to specify a value. Currently it is set as an extra cost but I'd like it to be added to the shipping cost. But I have 2 shipping methods and I am only able to select one option. Does this mean that I need to create 2 rules? And if so, don't I need a check to see which shipping cost needs to be incremented?
– Mike
Commented May 24, 2012 at 16:51
• @MikeHeremans If the shipping methods use same price component, one rule should work for both of them. Commented May 25, 2012 at 9:54
• I forgot to mention that they don't. So I created a rule for each of them and it works! Thanks again!
– Mike
Commented May 26, 2012 at 8:32