How to set shipping price to 0 when a specific field of product is enabled or has specific value I am using Drupal Commerce 7. I need to set the shipping price to zero when a field of product is enabled/checked (for example free ship field).

I know I should use Rules and Collecting shipping rates for an order event is suitable for my job, but I really don't know how to set up a condition to check if my field is enabled or has a specific value.

I can set the free ship field widget as check box with enable/disable or select box with 2 value, whichever fits my needs. But my problem is how to set the condition according the value of product field.

Thanks for your attention
How about this: In shipping calculation rule see if can get the following conditions.


Use execute php code, check in the php if can use $commerce_order
If can then loop through all product line items in the order load them check the field value.
On basis of condition return True so implement the action or false to not.