3

Well, the title is quite descriptive about what I'm trying to do with Rules for my e-shop. I have a flat rate for shippable products and I want to charge extra shipping costs to customers according to order's total weight. I'm already using physical fields for weight so I could use the field's value for this rule. Note that some products won't have anything in the weight field and in this case I don't want to take them into consideration for the shipping cost calculation.

So, I want to charge €3 (flat rate's base charge) if the order is 0-2 kilos. In case the total order's weight is more than 2 kilos, I want to add €1.2 to shipping cost for every additional kilo.

e.g. order has 3 products. Product 1 - 2 kilos Product 2 - 0 kilos (or no value in weight field) Product 3 - 2.5 kilos Total order's weight: 2+0+2.5 = 4.5 kilos (ie 2.5 kilos to be charged extra)

So the shipping charge should be €3 (flat rate's base) + €1.2*2.5 = €6.

I really need some guidance here on how I'm going to make this happen using Rules.

0

One of the problems with Commerce (and Ubercart for that matter) is that it takes awhile for someone to come around with weight based calculations. I have done something similar but it might not work for you.

1) I made each increment I wanted to allow a single product (i.e. 1lb of Product X is 1 QTY, if they want 2lbs of Product X, it's the same as saying Product X with 2 QTY.) 2) Then I created bundles for what I wanted to allow. 3) In shipping, you can set up a rule that allows extra for each extra QTY ($6 for 1 QTY and $2 for each additional QTY.)

For you, it might be possible to set your rule to multiply but you would have to create a module that would allow you to set percentages on QTY if you wanted someone to be able to add 1.2 QTY to their cart. For me, it was easier to do by whole increments and much cleaner on the rules. You can also set your shipping rule to line items so that the first line item is the base and the remaining are the additional.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.