You are here

function commerce_recurring_rules_order_is_master in Commerce Recurring Framework 7

Condition callback: checks to see if a recurring product exists on an order

File

./commerce_recurring.rules.inc, line 325

Code

function commerce_recurring_rules_order_is_master($order) {

  // If we actually received a valid order...
  if (!empty($order)) {
    $order_wrapper = entity_metadata_wrapper('commerce_order', $order);
    $next_due = $order_wrapper->commerce_recurring_next_due
      ->value();
    if (!empty($next_due)) {
      return TRUE;
    }
  }
  return FALSE;
}