Last active
November 13, 2017 08:54
-
-
Save ipwa/7c1dc0041c9a88d91a2279a337413327 to your computer and use it in GitHub Desktop.
Rule to make roomify booking charge for only one day of booking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "rules_chicama_pay_one_day" : { | |
"LABEL" : "Chicama pay one day", | |
"PLUGIN" : "reaction rule", | |
"OWNER" : "rules", | |
"REQUIRES" : [ "rules", "commerce_product_reference" ], | |
"ON" : { "commerce_product_calculate_sell_price" : [] }, | |
"IF" : [ | |
{ "entity_has_field" : { "entity" : [ "commerce-line-item" ], "field" : "commerce_product" } } | |
], | |
"DO" : [ | |
{ "variable_add" : { | |
"USING" : { "type" : "decimal", "value" : "0" }, | |
"PROVIDE" : { "variable_added" : { "oneday_price" : "One day price for this line item" } } | |
} | |
}, | |
{ "variable_add" : { | |
"USING" : { "type" : "decimal", "value" : "0" }, | |
"PROVIDE" : { "variable_added" : { "booking_days" : "Days" } } | |
} | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment