Skip to content

Instantly share code, notes, and snippets.

@mglaman
Last active December 24, 2015 08:49
Show Gist options
  • Save mglaman/6772905 to your computer and use it in GitHub Desktop.
Save mglaman/6772905 to your computer and use it in GitHub Desktop.
Drupal rule to provide free shipping on all shipping services using calculation rules.
{ "rules_free_shipping_offer" : {
"LABEL" : "Free Shipping offer",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "commerce_line_item", "commerce_shipping" ],
"ON" : [ "commerce_shipping_calculate_rate" ],
"IF" : [
{ "data_is" : { "data" : [ "commerce-line-item:type" ], "value" : "shipping" } },
{ "data_is" : {
"data" : [ "commerce-line-item:order:commerce-order-total:amount" ],
"op" : "\u003E",
"value" : "15000"
}
}
],
"DO" : [
{ "commerce_line_item_unit_price_amount" : {
"commerce_line_item" : [ "commerce_line_item" ],
"amount" : "0.00",
"component_name" : "shipping",
"round_mode" : "1"
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment