Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { "rules_user_price" : {
- "LABEL" : "User Price",
- "PLUGIN" : "reaction rule",
- "REQUIRES" : [ "rules", "commerce_line_item", "commerce_product_reference" ],
- "ON" : [ "commerce_product_calculate_sell_price" ],
- "IF" : [
- { "entity_has_field" : { "entity" : [ "commerce-line-item" ], "field" : "field_user_price" } }
- ],
- "DO" : [
- { "variable_add" : {
- "USING" : {
- "type" : "decimal",
- "value" : [ "commerce-line-item:field-user-price:amount-decimal" ]
- },
- "PROVIDE" : { "variable_added" : { "variable_added" : "Added variable" } }
- }
- },
- { "data_calc" : {
- "USING" : { "input_1" : [ "variable-added" ], "op" : "*", "input_2" : "100" },
- "PROVIDE" : { "result" : { "result" : "Calculation result" } }
- }
- },
- { "commerce_line_item_unit_price_amount" : {
- "commerce_line_item" : [ "commerce_line_item" ],
- "amount" : [ "result" ],
- "component_name" : "base_price",
- "round_mode" : "1"
- }
- }
- ]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement