diff --git uc_discount.module uc_discount.module
old mode 100644
new mode 100755
index 3d61bae..ac81b0b
--- uc_discount.module
+++ uc_discount.module
@@ -49,6 +49,8 @@ function uc_discount_form_alter(&$form, &$form_state, $form_id) {
     if (isset($form['quotes'])) {
       drupal_add_js(drupal_get_path('module', 'uc_discount') .'/uc_discount.js');
     }
+    // TODO: add validation for coupon code
+    $form['#submit'] = array_merge(array('uc_discount_edit_form_submit'), $form['#submit']);
   }
   else {
     $triggers = array_keys(uc_discount_ca_trigger());
@@ -71,6 +73,13 @@ function uc_discount_form_alter(&$form, &$form_state, $form_id) {
   }
 }
 
+function uc_discount_edit_form_submit($form, &$form_state) {
+  if($form_state['values']['coupon_code']) {
+    // store the submitted code for later use (eg. order load)
+    uc_discount_coupon_code($form_state['values']['coupon_code']);
+  }
+}
+
 /******************************************************************************
  * Ubercart hooks                                                             *
  ******************************************************************************/
@@ -127,6 +136,17 @@ function uc_discount_price_handler_alter(&$price_info, &$context, &$options) {
  */
 function uc_discount_order($op, $arg1, $arg2) {
   switch ($op) {
+    case 'load':
+      if($coupon_code = uc_discount_coupon_code()) {
+        $arg1->data['coupon_code'] = $coupon_code;
+      }
+      elseif(isset($_POST['coupon_code']) && isset($arg1->data['coupon_code'])) {
+        // this happens when we want to delete a coupon form an order
+        unset($arg1->data['coupon_code']);
+      }
+
+      break;
+
     case 'save':
       $changes = array();
       $discounts = uc_line_item_discount('load', $arg1);
@@ -147,6 +167,7 @@ function uc_discount_order($op, $arg1, $arg2) {
           ),
         );
         $predicates = ca_load_trigger_predicates('calculate_order_discounts');
+
         foreach ($predicates as $predicate) {
           if (ca_evaluate_conditions($predicate, $arguments)) {
             // serialize() and strpos() is faster than writing a recursive
@@ -267,6 +288,63 @@ function uc_line_item_discount($op, $order) {
   }
 }
 
+ /**
+ * Implementation of hook_order_pane
+ */
+function uc_discount_order_pane() {
+
+  $panes[] = array(
+    'id' => 'coupon_code',
+    'callback' => 'uc_order_pane_coupon_discount',
+    'title' => t('Discount Codes'),
+    'desc' => t('Discount 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':
+      $tmp = uc_checkout_pane_coupon_discount('view', $arg1, NULL);
+      $form['coupons'] =array(
+        '#type' => 'fieldset',
+        '#title' => t('Add coupon code'),
+        '#collapsible' => TRUE,
+        '#collapsed' => FALSE,
+      );
+
+      $form['coupons'] += $tmp['contents'];
+
+      return $form;
+      break;
+
+    case 'edit-theme':
+      $output = drupal_render($arg1['coupons']);
+      return $output;
+
+    case 'edit-process':
+      // this portion is called after hook_order('load')
+      // so we can't store the coupon code here...
+      return;
+  }
+}
+
+function uc_discount_coupon_code($new_coupon = NULL) {
+  static $coupon_code = NULL;
+
+  if(!is_null($new_coupon)) {
+    $coupon_code = $new_coupon;
+  }
+  return $coupon_code;
+}
+
 /**
  * Implementation of hook_line_item_alter().
  */
