Vote up!
Vote down!

Complex Flat Rate Shipping

A client has a flat rate shipping table.
It is grouped into three zones (US-only, multiple states per zone), and then by quanity of items (1-2, 3-10, 10+).
Plus, if an item costs more than a certain $ amount, it counts as (2) items.

1. Customer is from OH and orders 2 items (under $15) it should go in the zone with OH and use the 1-2 item rate for that zone.
2. Customer is from KY and orders 2 books under $5 and one book over $15.. it should go to the zone with KY and calculate as 4 items for shipping.

Between the zones and item-range it gives me 9 options (plus the >$15 item count issue).

I have Drupal Commerce Kickstart and the Shipping and Flat Rate Shipping modules installed.
I created a computed field (using the computed field module) in my product that sets a 1 or 2 depending on the price.
I am not sure if I can use this field in drupal commerce rules to help calculate the shipping rate.

Any ideas on where to start?

Asked by: rootgear
on July 3, 2012

1 Answer

Vote up!
Vote down!

In order for rules to understand and react to your fields of an entity, you need to add a condition "Entity has field" and then you can create another condition on any field for that condition.


Also, this a FAQ...


Josh Miller
Answer by: Josh Miller
Posted: Jul 13, 2012


dear joshmiller,
I can't add the "Entity has field" condition in a shipping rate rule, because I can't choose my product's custom-field, I can only select "commerce-order" field.

Let my explain. My shipping cost depends from state (in shipping information, rule work), from number of products in a order (work!) and from size of product-box (S, M, L), so my product type have a custom field (field_box). Now I can't understand ho apply this rule!


- Amnesiac on September 7, 2012