Advertisement
MrJoshMiller

Implement shipping if tagged with a term 2 of 2

Jun 20th, 2013
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. { "rules_implement_shipping_if_content_is_tagged_with_a_term" : {
  2.     "LABEL" : "Implement shipping if content is tagged with a term",
  3.     "PLUGIN" : "rule",
  4.     "REQUIRES" : [ "rules", "commerce_shipping" ],
  5.     "USES VARIABLES" : {
  6.       "order" : { "label" : "order", "type" : "commerce_order" },
  7.       "line_item" : { "label" : "line_item", "type" : "commerce_line_item" }
  8.     },
  9.     "IF" : [
  10.       { "entity_is_of_bundle" : {
  11.           "entity" : [ "line-item" ],
  12.           "type" : "commerce_line_item",
  13.           "bundle" : { "value" : { "product" : "product" } }
  14.         }
  15.       },
  16.       { "entity_has_field" : { "entity" : [ "line-item" ], "field" : "commerce_product" } },
  17.       { "entity_has_field" : { "entity" : [ "line-item:commerce-product" ], "field" : "field_tags" } },
  18.       { "list_contains" : { "list" : [ "line-item:commerce-product:field-tags" ], "item" : "1" } }
  19.     ],
  20.     "DO" : [
  21.       { "commerce_shipping_service_rate_order" : { "shipping_service_name" : "free", "commerce_order" : [ "order" ] } }
  22.     ],
  23.     "PROVIDES VARIABLES" : [ "order", "line_item" ]
  24.   }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement