You are here

function commerce_purchase_order_number_from_order_id in Commerce Purchase Order 7

Returns a PO number from an order id

File

./commerce_purchase_order.module, line 239
Provides an example payment method for Drupal Commerce for testing and development.

Code

function commerce_purchase_order_number_from_order_id($order_id) {
  $result = db_select('commerce_purchase_order', 'c')
    ->fields('c')
    ->condition('order_id', $order_id, '=')
    ->execute()
    ->fetchAssoc();
  if ($result) {
    return $result['po_number'];
  }
  else {
    return '';
  }
}