You are here

function uc_recurring_order_recurring_renewal_pending in UC Recurring Payments and Subscriptions 7.2

Same name and namespace in other branches
  1. 6.2 modules/uc_recurring_order/uc_recurring_order.module \uc_recurring_order_recurring_renewal_pending()

Implements hook_recurring_renewal_pending().

File

modules/uc_recurring_order/uc_recurring_order.module, line 345
Provides a way to duplicate entire orders.

Code

function uc_recurring_order_recurring_renewal_pending(&$order, $fee) {

  // recreate order
  if (!empty($fee->data['uc_recurring_order'])) {
    $order->products = $fee->data['uc_recurring_order']['products'];
    $result = db_query("SELECT * FROM {uc_order_line_items} WHERE order_id = :order_id", array(
      ':order_id' => $fee->order_id,
    ));
    foreach ($result as $line_item) {
      uc_order_line_item_add($order->order_id, $line_item->type, $line_item->title, $line_item->amount, $line_item->weight, $line_item->data);
    }
  }
}