ipwa
11/13/2017 - 8:50 AM

Rule to make roomify booking charge for only one day of booking

Rule to make roomify booking charge for only one day of booking

{ "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" } }
        }
      }
    ]
  }
}