function uc_recurring_order_view_update_form_submit in Ubercart 5
File
- payment/
uc_recurring/ uc_recurring.module, line 181 - Allows you to add a recurring fee to a product/SKU to handle subscription type services.
Code
function uc_recurring_order_view_update_form_submit($form_id, $form_values) {
if ($form_values['process_fees']) {
$order = uc_order_load($form_values['order_id']);
$fees = uc_recurring_find_fees($order);
if (count($fees)) {
$pass = TRUE;
foreach ($fees as $fee) {
if (!uc_recurring_process($order, $fee)) {
uc_order_comment_save($order->order_id, 0, t('The recurring fee for product @model failed.', array(
'@model' => $fee->model,
)), 'admin', $order->order_status);
$pass = FALSE;
}
}
if ($pass == FALSE) {
drupal_set_message(t('One or more recurring fees failed to process as indicated in the admin comments.'), 'error');
}
}
}
}