Advertisement
MrJoshMiller

Access Product fields when calculating price.

Apr 8th, 2013
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. { "rules_test_rule" : {
  2.     "LABEL" : "Display image file name on price calculation",
  3.     "PLUGIN" : "reaction rule",
  4.     "REQUIRES" : [ "rules", "commerce", "commerce_product_reference" ],
  5.     "ON" : [ "commerce_product_calculate_sell_price" ],
  6.     "IF" : [
  7.       { "entity_is_of_type" : { "entity" : [ "commerce-line-item" ], "type" : "commerce_line_item" } },
  8.       { "entity_has_field" : { "entity" : [ "commerce-line-item" ], "field" : "commerce_product" } },
  9.       { "entity_exists" : {
  10.           "type" : "commerce_product",
  11.           "property" : "product_id",
  12.           "value" : [ "commerce-line-item:commerce-product:product-id" ]
  13.         }
  14.       },
  15.       { "entity_has_field" : {
  16.           "entity" : [ "commerce-line-item:commerce-product" ],
  17.           "field" : "field_image"
  18.         }
  19.       }
  20.     ],
  21.     "DO" : [
  22.       { "drupal_message" : { "message" : [ "commerce-line-item:commerce-product:field-image:file:name" ] } }
  23.     ]
  24.   }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement