Why does this rule fire even though the first condition evaluates to FALSE?

0 ms Reacting on event Calculating the sell price of a product.
0.227 ms Evaluating conditions of rule Back Issue Shipping. [edit]
0.383 ms The condition commerce_order_compare_address evaluated to FALSE [edit]
0.513 ms The condition data_is evaluated to TRUE [edit]
0.676 ms The condition entity_has_field evaluated to TRUE [edit]
0.689 ms AND evaluated to TRUE.
"Rule Back Issue Shipping fires

I'm thinking that since this is a Calculating Sell Price rule, the Order Address doesn't exist, but there doesn't seem to be a way to check if it exists.

Here is the Rule:
{ "rules_back_issue_shipping" : {
"LABEL" : "Back Issue Shipping",
"PLUGIN" : "reaction rule",
"REQUIRES" : [
"commerce_order",
"rules",
"commerce_line_item",
"commerce_product_reference"
],
"ON" : [ "commerce_product_calculate_sell_price" ],
"IF" : [
{ "NOT commerce_order_compare_address" : {
"commerce_order" : [ "commerce-line-item:order" ],
"address_field" : "commerce_customer_shipping|commerce_customer_address",
"address_component" : "country",
"value" : "US"
}
},
{ "data_is" : { "data" : [ "commerce-line-item:type" ], "value" : "product" } },
{ "entity_has_field" : {
"entity" : [ "commerce-line-item:commerce-product" ],
"field" : "field_bi_international_shipping"
}
}
],
"DO" : [
{ "data_calc" : {
"USING" : {
"input_1" : [ "commerce-line-item:quantity" ],
"op" : "*",
"input_2" : [
"commerce-line-item:commerce-product:field-bi-international-shipping:amount"
]
},
"PROVIDE" : { "result" : { "back_issue_shipping" : "Back Issue Shipping" } }
}
},
{ "commerce_line_item_unit_price_add" : {
"commerce_line_item" : [ "commerce_line_item" ],
"amount" : [ "back-issue-shipping" ],
"component_name" : "flat_rate_international_shipping",
"round_mode" : "0"
}
}
]
}
}

Comments

googletorp’s picture

Status: Active » Closed (won't fix)

Rules support is not handled in the issue queue, there are many places where you can get support for something like this. You could try the Drupal commerce Q&A section, the forums, Drupal answers etc.