===================================================================
--- includes/views/commerce_option.views.inc	(revision )
+++ includes/views/commerce_option.views.inc	(revision )
@@ -1,27 +1,52 @@
 <?php
 
 /**
- * Export Drupal Commerce orders to Views.
+ * Implements hook_views_data_alter().
+ * @param $data
  */
+function commerce_option_views_data_alter(&$data){
 
+  $data['commerce_product']['commerce_option'] = array(
+    'title' => t('Related option sets'),
+    'relationship' => array(
+      'base' => 'commerce_option',
+      'base field' => 'product_id',
+      'field' => 'product_id',
+      'handler' => 'views_handler_relationship',
+      'label' => t('Commerce option'),
+      'title' => t('Commerce options referenced by this product'),
+      'help' => t('Relate a product to commerce options it references.'),
+    )
+  );
 
+  $data['commerce_line_item']['commerce_option'] = array(
+    'title' => t('Related option sets'),
+    'relationship' => array(
+      'base' => 'commerce_option',
+      'base field' => 'line_item_id',
+      'field' => 'line_item_id',
+      'handler' => 'views_handler_relationship',
+      'label' => t('Commerce option'),
+      'title' => t('Commerce options referenced by this line item'),
+      'help' => t('Relate a line item to commerce options it references.'),
+    )
+  );
 
-
-function commerce_option_views_data_alter(&$data){
-  foreach ($data as $table_name => &$table){
-    if ($table_name == 'commerce_line_item'){
-      /*foreach($table as $field_name => &$field) {
-        if($field_name == 'type') {
-          $field['relationship'] = array(
-            'base' => 'commerce_order_total_line_type',
+  $data['commerce_option']['product_id']['relationship'] = array(
+    'base' => 'commerce_product',
+    'base field' => 'product_id',
-            'handler' => 'views_handler_relationship',
+    'handler' => 'views_handler_relationship',
-            'label' => t('Order Total Type'),
-            'base field' => 'line_item_type',
-            'field' => 'type',
+    'label' => t('Product'),
+    'title' => t('Products that reference this option'),
+    'help' => t('Relate an option to the products referencing it.')
-          );
+  );
-        }
-      }*/
 
-    }
-  }
+  $data['commerce_option']['line_item_id']['relationship'] = array(
+    'base' => 'commerce_line_item',
+    'base field' => 'line_item_id',
+    'handler' => 'views_handler_relationship',
+    'label' => t('Line item'),
+    'title' => t('Line items that reference this option'),
+    'help' => t('Relate an option to the line items referencing it.')
+  );
 }
