You are here

function commerce_addressbook_rules_profile_is_default in Commerce Addressbook 7.3

Same name and namespace in other branches
  1. 7.2 commerce_addressbook.rules.inc \commerce_addressbook_rules_profile_is_default()

Rules condition: checks if profile is user's default customer profile.

Parameters

$customer_profile: The customer profile to check.

Return value

bool TRUE or FALSE if profile IDs match.

1 string reference to 'commerce_addressbook_rules_profile_is_default'
commerce_addressbook_rules_condition_info in ./commerce_addressbook.rules.inc
Implement hook_rules_condition_info()

File

./commerce_addressbook.rules.inc, line 61
Rules integration for Commerce Addressbook.

Code

function commerce_addressbook_rules_profile_is_default($customer_profile) {
  return commerce_addressbook_get_default_profile_id($customer_profile->uid, $customer_profile->type) == $customer_profile->profile_id;
}