Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Drupal Commerce: Price Product Based on Product Type
{ "rules_price_square_widgets" : {
"LABEL" : "Set price of square widgets",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "commerce_line_item", "commerce_product_reference" ],
"ON" : { "commerce_product_calculate_sell_price" : [] },
"IF" : [
{ "entity_has_field" : { "entity" : [ "commerce-line-item" ], "field" : "commerce_product" } },
{ "data_is" : {
"data" : [ "commerce-line-item:commerce-product:type" ],
"value" : "square_widgets"
}
}
],
"DO" : [
{ "commerce_line_item_unit_price_amount" : {
"commerce_line_item" : [ "commerce_line_item" ],
"amount" : "1000",
"component_name" : "base_price",
"round_mode" : "1"
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.