Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save klickreflex/362faab675d80da48c42 to your computer and use it in GitHub Desktop.
Save klickreflex/362faab675d80da48c42 to your computer and use it in GitHub Desktop.
Drupal: Disable Shipping pane and shipping address collection if order contains only products of certain type
{ "rules_disable_shipping_digital" : {
"LABEL" : "Disable Shipping for Digital Products",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "commerce_order", "commerce_rules_extra" ],
"ON" : { "process_checkout_pane" : [] },
"IF" : [
{ "NOT commerce_order_contains_product_type" : {
"commerce_order" : [ "commerce_order" ],
"product_type" : { "value" : { "physical_product" : "physical_product" } },
"operator" : "\u003E=",
"value" : "1"
}
}
],
"DO" : [
{ "commerce_rules_extra_change_pane" : {
"pane_id" : "customer_profile_shipping",
"page_id" : "\u003Csame\u003E",
"enabled" : 0
}
},
{ "commerce_rules_extra_change_pane" : {
"pane_id" : "commerce_shipping",
"page_id" : "\u003Csame\u003E",
"enabled" : 0
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment