I dont think this is possible with Dcommerce.
I achieved this adding another option in
\modules\contrib\commerce\modules\order\commerce_order.rules.inc
function commerce_order_address_comparison_operator_options_list() {
return array(
'equals' => t('equals'),
'begins with' => t('begins with'),
'contains' => t('contains'),
'is one of' => t('is one of'),/*Newly added*/
);
}
and added a new switch case condition here for that
function commerce_order_rules_compare_address($order, $address_field, $component, $operator, $value) {
list($field_name, $address_field_name) = explode('|', $address_field);
// If we actually received a valid order...
if (!empty($order)) {
$wrapper = entity_metadata_wrapper('commerce_order', $order);
// And if we can actually find the requested address data...
if (!empty($wrapper->{$field_name}) && !empty($wrapper->{$field_name}->{$address_field_name})) {
$address = $wrapper->{$field_name}->{$address_field_name}->value();
// Make a comparison based on the operator.
switch ($operator) {
case 'equals':
return $address[$component] == $value;
case 'begins with':
return strpos($address[$component], $value) === 0;
case 'contains':
return strpos($address[$component], $value) !== FALSE;
case 'is one of':
$list = preg_split('/[\n\r]+/', $value);
if( in_array( $address[$component] ,$list ))
return true;
else
return false;
}
}
}
return FALSE;
}
This changes worked fro me