diff --git a/uc_bulk_stock_updater.inc b/uc_bulk_stock_updater.inc
index f134fec..37b43d1 100644
--- a/uc_bulk_stock_updater.inc
+++ b/uc_bulk_stock_updater.inc
@@ -15,19 +15,19 @@
 function uc_bulk_stock_updater_stock_update() {
   drupal_add_css(drupal_get_path('module', 'uc_stock') . '/uc_stock.css');
   drupal_add_css(drupal_get_path('module', 'uc_bulk_stock_updater') . '/uc_bulk_stock_updater.css');
-  
+
   $js_settings = array(
-    'ajax_url' => url(_UC_BULK_STOCK_UPDATER_MENU_UPDATE_AJAX), 
+    'ajax_url' => url(_UC_BULK_STOCK_UPDATER_MENU_UPDATE_AJAX),
   );
   drupal_add_js(array('uc_bulk_stock_updater' => $js_settings), 'setting');
-  
+
   drupal_add_js(drupal_get_path('module', 'uc_bulk_stock_updater') . '/uc_bulk_stock_updater.js');
-  
-  $viewing_all_records = !is_null($_GET['nopage']); 
+
+  $viewing_all_records = !is_null($_GET['nopage']);
   $page_size = ($viewing_all_records ? UC_REPORTS_MAX_RECORDS : variable_get('uc_reports_table_size', 30));
   $rows = array();
 
-  
+
   // table headers
   $header = array(
     array('data' => t('SKU'), 'field' => 'sku', 'sort' => 'asc'),
@@ -47,13 +47,13 @@ function uc_bulk_stock_updater_stock_update() {
   // add in the editable fields to headers and SQL query field list
   foreach ($editable_fields as $f => $f_info) {
     $header[] = $f_info['header'];
-    $sql_field[$f_info['db_field']] = $f; 
+    $sql_field[$f_info['db_field']] = $f;
   }
 
   // extract list of db object field names
   $fn_field_names_from_header_arr = create_function('$v', 'return $v["field"];');
   $db_obj_field_names = array_map($fn_field_names_from_header_arr, $header);
-  
+
   // construct SQL query
   $fn_sql_field_map = create_function('&$v,$k', '$v = "$k as \"$v\"";');
   array_walk($sql_field, $fn_sql_field_map);
@@ -63,33 +63,33 @@ function uc_bulk_stock_updater_stock_update() {
     LEFT JOIN {uc_products} u ON s.nid = u.nid
     WHERE active = 1 AND title <> ""
   ';
-  
+
   // execute query
   $result = pager_query($sql . tablesort_sql($header), $page_size, 0, NULL);
-  
+
   // NOTE: we don't push this stuff into the theming method because we need to set
   // certain attributes in order to ensure the AJAX update works properly.
   $products = array();
   $item_index = 0;
   while ($stock = db_fetch_object($result)) {
     ++$item_index;
-    
+
     // sanitize for output
     $filter_val = array();
     foreach ($db_obj_field_names as $n) {
       $stock->$n = check_plain($stock->$n);
       $filter_val[] = $stock->$n;
     }
-    
+
     // for filtering purposes
     $filter_val = implode('__', array_map('drupal_strtolower',  $filter_val));
-    
+
     // Construct the data row
     $data_row = array(
       array('data' => "<span id='$filter_val'>$stock->sku</span>"),
       array('data' => l($stock->title, 'node/' . $stock->nid)),
     );
-    
+
     // construct stock editable fields
     foreach ($editable_fields as $f => $f_info) {
       $data_row[] = array(
@@ -103,35 +103,35 @@ function uc_bulk_stock_updater_stock_update() {
                 ))
       );
     }
-    
+
     $rows[] = array(
-        'data' => $data_row, 
+        'data' => $data_row,
         'class' => (intval($stock->stock_threshold) >= intval($stock->stock)) ? 'uc-stock-below-threshold' : 'uc-stock-above-threshold',
     );
   }
-  
+
   return theme('uc_bulk_stock_updater_table', $page_size, $viewing_all_records, $header, $rows);
 }
 
 
 /**
  * Theming for the table.
- * 
+ *
  * @param $page_size the number of items we're showing on this page.
  * @param $viewing_all_records TRUE if we're viewing all available records; FALSE if we're paging.
  * @param $table_header the table header titles.
  * @param $rows the rows of the table.
  */
 function theme_uc_bulk_stock_updater_table($page_size, $viewing_all_records, array $table_header, array $rows) {
-  
+
   $output = '';
-  
-  $link = '<div class="uc-reports-links">' 
-               . ($viewing_all_records ? l(t('Show paged records'), _UC_BULK_STOCK_UPDATER_MENU_UPDATE) : l(t('Show all records'), _UC_BULK_STOCK_UPDATER_MENU_UPDATE, $options = array('query' => 'nopage=1'))) 
+
+  $link = '<div class="uc-reports-links">'
+               . ($viewing_all_records ? l(t('Show paged records'), _UC_BULK_STOCK_UPDATER_MENU_UPDATE) : l(t('Show all records'), _UC_BULK_STOCK_UPDATER_MENU_UPDATE, $options = array('query' => 'nopage=1')))
                . '</div>';
-  
+
   $output .= $link;
-               
+
   // add filter field
   if ($viewing_all_records) {
     $output .= theme_textfield(array(
@@ -144,27 +144,27 @@ function theme_uc_bulk_stock_updater_table($page_size, $viewing_all_records, arr
 
   $output .= theme('table', $table_header, $rows, array('width' => '100%', 'class' => 'uc-stock-table'))
           . theme('pager', NULL, $page_size);
-          
+
   $output .= $link;
-  
+
   return $output;
 }
 
 
-/** 
+/**
  * AJAX callback.
  */
 function uc_bulk_stock_updater_stock_update_ajax() {
   $sku = empty($_POST['sku']) ? FALSE : $_POST['sku'];
   $name = $_POST['name'];
   $value = $_POST['value'];
-  
+
   // validate and sanitize
   $value = BulkStockUpdater::sanitize_field($name, $value);
-  
+
   if (FALSE === $sku || FALSE === $value) {
   $err = t('Invalid parameters supplied');
-  } 
+  }
   else {
     if (!BulkStockUpdater::update_db($sku, $name, $value))
         $err = t('Error updating database');
@@ -182,11 +182,12 @@ function uc_bulk_stock_updater_stock_update_ajax() {
 
 
 class BulkStockUpdater {
-  
+
   // AJAX params
   const FIELD_SELL_PRICE = 'sell_price';
   const FIELD_STOCK = 'stock';
   const FIELD_STOCK_THRESHOLD = 'stock_threshold';
+  const FIELD_ACTIVE = 'active';
 
   /**
    * Get editable fields.
@@ -211,16 +212,21 @@ class BulkStockUpdater {
         'output_formatter' => 'intval',
         'header' => array('data' => t('Stock threshold'), 'field' => 'stock_threshold')
       ),
+	   self::FIELD_ACTIVE => array(
+        'db_field' => 's.active',
+        'output_formatter' => 'intval',
+        'header' => array('data' => t('Active'), 'field' => 'active')
+      ),
     );
   }
 
 
   /**
    * Validate and sanitize submitted form data.
-   * 
+   *
    * @param $_field_name name of field we're validating
    * @param $_field_value value to validate.
-   * 
+   *
    * @return sanitized value if validated successfully; FALSE otherwise.
    */
   public static function sanitize_field($_field_name, $_field_value) {
@@ -239,20 +245,25 @@ class BulkStockUpdater {
         $_field_value = intval($_field_value);
         if (0 > $_field_value)
           return FALSE;
+	    break;
+	  case self::FIELD_ACTIVE:
+        $_field_value = intval($_field_value);
+        if (0 > $_field_value)
+          return FALSE;
         break;
       default:
         return FALSE;
     }
     return $_field_value;
-  }   
-  
+  }
+
   /**
    * Update the given field for the given product.
-   * 
+   *
    * @param unknown_type $_sku
    * @param unknown_type $_field_name
    * @param unknown_type $_field_value it is assumed that is a valid value for this field
-   * 
+   *
    * @return TRUE if successful; FALSE otherwise.
    */
   public static function update_db($_sku, $_field_name, $_field_value) {
@@ -263,7 +274,7 @@ class BulkStockUpdater {
             return FALSE;
         else
             return TRUE;
-            
+
       case self::FIELD_STOCK_THRESHOLD:
         if (!db_query("UPDATE {uc_product_stock} SET threshold = %d WHERE sku = '%s'", $_field_value, $_sku))
             return FALSE;
@@ -275,8 +286,13 @@ class BulkStockUpdater {
             return FALSE;
         else
             return TRUE;
-        
-    }    
+	   case self::FIELD_ACTIVE:
+        if (!db_query("UPDATE {uc_product_stock} SET active = %f WHERE sku = '%s'", $_field_value, $_sku))
+            return FALSE;
+        else
+            return TRUE;
+
+    }
   }
 }
 
