Created
September 10, 2013 17:07
-
-
Save mglaman/6512450 to your computer and use it in GitHub Desktop.
If you're using Flat Rate shipping on Drupal Commerce, this update rule will prevent calculation of the customer shipping profile is empty.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "commerce_shipping_method_flat_rate" : { | |
"LABEL" : "Collect rates: Flat rate", | |
"PLUGIN" : "reaction rule", | |
"REQUIRES" : [ "rules", "commerce_shipping" ], | |
"ON" : [ "commerce_shipping_collect_rates" ], | |
"IF" : [ | |
{ "entity_has_field" : { | |
"entity" : [ "commerce-order" ], | |
"field" : "commerce_customer_shipping" | |
} | |
}, | |
{ "NOT data_is_empty" : { "data" : [ "commerce-order:commerce-customer-shipping" ] } } | |
], | |
"DO" : [ | |
{ "commerce_shipping_method_collect_rates" : { | |
"shipping_method_name" : "flat_rate", | |
"commerce_order" : [ "commerce-order" ] | |
} | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment