=== modified file 'uc_discount.module'
--- uc_discount.module	2009-06-16 21:25:53 +0000
+++ uc_discount.module	2009-06-17 19:22:29 +0000
@@ -306,6 +306,54 @@
 }
 
 /**
+ * Implementation of hook_order_pane
+ */
+function uc_discount_order_pane() {
+
+  $panes[] = array(
+    'id' => 'coupon_code',
+    'callback' => 'uc_order_pane_coupon_discount',
+    'title' => t('Coupon Codes'),
+    'desc' => t('Coupon codes.'),
+    'class' => 'pos-left',
+    'weight' => 7,
+    'show' => array('edit'),
+  );
+
+  return $panes;
+}
+
+/**
+ * Callback from hook_order_pane
+ */
+function uc_order_pane_coupon_discount($op, $arg1) {
+  switch ($op) {
+    case 'edit-form':
+      $pane = uc_checkout_pane_coupon_discount('view', $arg1, NULL);
+      $form['coupons'] = $pane['contents'];
+      unset($form['coupons']['coupon_code']['#title']);
+
+      $form['coupons']['add_coupon'] = array(
+        '#type' => 'submit',
+        '#value' => t('Apply coupon'),
+      );
+
+      return $form;
+    case 'edit-theme':
+      return drupal_render($arg1['coupons']);
+    case 'edit-ops':
+      return array(t('Apply coupon'));
+    case t('Apply coupon'):
+      if ($order = uc_order_load($arg1['order_id'])) {
+        $order->data['coupon_code'] = $arg1['coupon_code'];
+
+        uc_order_save($order);
+      }
+      break;
+  }
+}
+
+/**
  * Implementation of hook_discount_registry().
  */
 function uc_discount_discount_registry() {

