You are here

function uc_2checkout_form_alter in Ubercart 5

Same name and namespace in other branches
  1. 6.2 payment/uc_2checkout/uc_2checkout.module \uc_2checkout_form_alter()

Implementation of hook_form_alter().

File

payment/uc_2checkout/uc_2checkout.module, line 43
Integrates 2Checkout.com's redirected payment service.

Code

function uc_2checkout_form_alter($form_id, &$form) {
  if ($form_id == 'uc_cart_checkout_review_form' && ($order_id = intval($_SESSION['cart_order'])) > 0) {
    $order = uc_order_load($order_id);
    if ($order->payment_method == '2checkout') {
      unset($form['submit']);
      $form['#prefix'] = '<table style="display: inline; padding-top: 1em;"><tr><td>';
      $form['#suffix'] = '</td><td>' . drupal_get_form('uc_2checkout_form', $order) . '</td></tr></table>';
    }
  }
}