MrJoshMiller

Taxes based on Content Type - Part 1 of 2

Jun 20th, 2013
149
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. { "commerce_tax_type_vat" : {
  2.     "LABEL" : "Calculate taxes: VAT",
  3.     "PLUGIN" : "reaction rule",
  4.     "TAGS" : [ "Commerce Tax" ],
  5.     "REQUIRES" : [ "rules", "commerce_product_reference" ],
  6.     "ON" : [ "commerce_product_calculate_sell_price" ],
  7.     "IF" : [
  8.       { "entity_has_field" : { "entity" : [ "commerce-line-item" ], "field" : "commerce_product" } }
  9.     ],
  10.     "DO" : [
  11.       { "entity_query" : {
  12.           "USING" : {
  13.             "type" : "node",
  14.             "property" : "field_product",
  15.             "value" : [ "commerce-line-item:commerce-product:product-id" ],
  16.             "limit" : "1"
  17.           },
  18.           "PROVIDE" : { "entity_fetched" : { "display_node" : "Display Node" } }
  19.         }
  20.       },
  21.       { "component_rules_apply_tax_if_display_node_is_certain_type" : {
  22.           "USING" : {
  23.             "line_item" : [ "commerce-line-item" ],
  24.             "display_node" : [ "display-node:0" ]
  25.           },
  26.           "PROVIDE" : {
  27.             "line_item" : { "line_item" : "line_item" },
  28.             "display_node" : { "display_node0" : "display_node" }
  29.           }
  30.         }
  31.       }
  32.     ]
  33.   }
  34. }
RAW Paste Data