Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { "rules_require_product_2" : {
- "LABEL" : "Require Product 2",
- "PLUGIN" : "reaction rule",
- "REQUIRES" : [ "commerce_order", "rules", "commerce_cart" ],
- "ON" : [ "commerce_cart_product_add" ],
- "IF" : [
- { "NOT commerce_order_contains_product" : {
- "commerce_order" : [ "commerce-order" ],
- "product_id" : "PROD-02",
- "operator" : "=",
- "value" : "1"
- }
- }
- ],
- "DO" : [
- { "drupal_message" : {
- "message" : "Sorry, in order to add that to your cart, you must add Product #2",
- "type" : "warning"
- }
- },
- { "LOOP" : {
- "USING" : { "list" : [ "commerce-order:commerce-line-items" ] },
- "ITEM" : { "list_item" : "Current list item" },
- "DO" : [
- { "list_remove" : {
- "list" : [ "commerce-order:commerce-line-items" ],
- "item" : [ "list-item" ]
- }
- }
- ]
- }
- }
- ]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement