diff --git a/apachesolr_ubercart.info b/apachesolr_ubercart.info
index 751b58e..59cf3e1 100644
--- a/apachesolr_ubercart.info
+++ b/apachesolr_ubercart.info
@@ -1,5 +1,11 @@
 name = ApacheSolr Ubercart integration
 description = Integrates the ApacheSolr and Ubercart
 package = Apache Solr
-core = "6.x"
-php = 5.1.4
+core = 7.x
+
+dependencies[]=apachesolr_search
+dependencies[]=uc_product
+
+files[]=apachesolr_ubercart.module
+files[]=apachesolr_ubercart.views.inc
+
diff --git a/apachesolr_ubercart.module b/apachesolr_ubercart.module
index 161bdac..386d82e 100644
--- a/apachesolr_ubercart.module
+++ b/apachesolr_ubercart.module
@@ -1,157 +1,288 @@
 <?php
 
 /**
- * Implementation of hook_apachesolr_update_index().
+ * Implements hook_apachesolr_index_document_build().
  *
  * This adds Ubercart specific fields to the Solr index.
  */
-function apachesolr_ubercart_apachesolr_update_index(&$document, $node) {
-  if (in_array($node->type, module_invoke_all('product_types'))) {
-
-    if(!empty($node->model)) {
-      $document->ss_uc_sku = $node->model;
+ 
+function apachesolr_ubercart_apachesolr_index_document_build(ApacheSolrDocument $document, $entity, $env_id) { 
+  
+  if (in_array($entity->type, uc_product_types())) {
+     
+    if (!empty($entity->model)) {
+      $document->ss_uc_sku = $entity->model;
+    }
+    if (!empty($entity->list_price)) {
+      $document->fs_uc_list_price = uc_price($entity->list_price, array('revision' => 'altered', 'type' => $entity->type, 'subject' => array('node' => $entity->node)));
     }
-    if (!empty($node->list_price)) {
-      $document->fs_uc_list_price = $node->list_price;
+    if (!empty($entity->sell_price)) {
+      $document->fs_uc_sell_price = uc_price($entity->sell_price, array('revision' => 'altered', 'type' => $entity->type, 'subject' => array('node' => $entity->node)));
     }
-    if (!empty($node->sell_price)) {
-      $document->fs_uc_sell_price = $node->sell_price;
+    if (!empty($entity->weight)) {
+      $document->fss_uc_weight = $entity->weight;
     }
-    if(!empty($node->weight)) {
-      $document->fs_uc_weight = $node->weight;
+    if (!empty($entity->length)) {
+      $document->fss_uc_length = $entity->length;
     }
-    if(!empty($node->length)) {
-      $document->fs_uc_length = $node->length;
+    if (!empty($entity->width)) {
+      $document->fss_uc_width = $entity->width;
     }
-    if(!empty($node->width)) {
-      $document->fs_uc_width = $node->width;
+    if (!empty($entity->height)) {
+      $document->fss_uc_height = $entity->height;
     }
-    if(!empty($node->height)) {
-      $document->fs_uc_height = $node->height;
+    if (!empty($entity->ordering)) {
+       $document->fs_uc_position = $entity->ordering;
+     }
+    
+    //index also how many times a product has been sold
+    $stat = db_result(db_query('SELECT SUM(qty) FROM {uc_order_products} WHERE nid = %d', $entity->nid));
+    //to prevent Apache Solr Errors while indexing empty values
+    if (empty($stat)) {
+      $stat = 0;
+    }
+    $document->fss_common_num_sold = $stat;
+
+    //attributes
+    if (!empty($entity->attributes)) {
+      foreach ($entity->attributes as $attribute) {
+        $solr_index_name ="sm_uc_attribute_".$attribute->aid;
+        foreach ($attribute->options as $options) {
+          //we could choose to use oid or to use string
+          //for max maintainabilityand "hookability" we go for oid
+          //we will use theming functions to output decent names
+          $document->setMultiValue($solr_index_name, $options->oid);
+        }
+      }
     }
   }
 }
 
 /**
- * Implementation of hook_apachesolr_facets().
+ * Implements hook_apachesolr_facets().
  */
+ 
 function apachesolr_ubercart_apachesolr_facets() {
   $facets = array();
   //ubercart list prices
-  $facets['fs_uc_sell_price'] = array(
+  $facets['fss_uc_sell_price'] = array(
     'info' => t('Apache Solr Search: Filter by Price (Selling price)'),
-    'facet_field' => 'fs_uc_sell_price',
+    'facet_field' => 'fss_uc_sell_price',
     'dividable' => TRUE,
   );
-  $facets['fs_uc_list_price'] = array(
+  $facets['fss_uc_list_price'] = array(
     'info' => t('Apache Solr Search: Filter by Price (Listed price)'),
-    'facet_field' => 'fs_uc_list_price',
+    'facet_field' => 'fss_uc_list_price',
     'dividable' => TRUE,
   );
   $facets['ss_uc_sku'] = array(
-    'info' => t('Apache Solr Search: Filter by Model'),
+    'info' => t('Apache Solr Search: Filter by Model)'),
     'facet_field' => 'ss_uc_sku',
   );
-  $facets['fs_uc_weight'] = array(
-    'info' => t('Apache Solr Search: Filter by Weight'),
-    'facet_field' => 'fs_uc_weight',
+  $facets['fss_uc_weight'] = array(
+    'info' => t('Apache Solr Search: Filter by weight'),
+    'facet_field' => 'fss_uc_weight',
     'dividable' => TRUE,
   );
-  $facets['fs_uc_length'] = array(
-    'info' => t('Apache Solr Search: Filter by Length'),
-    'facet_field' => 'fs_uc_length',
+  $facets['fss_uc_length'] = array(
+    'info' => t('Apache Solr Search: Filter by length'),
+    'facet_field' => 'fss_uc_length',
     'dividable' => TRUE,
   );
-  $facets['fs_uc_width'] = array(
-    'info' => t('Apache Solr Search: Filter by Width'),
-    'facet_field' => 'fs_uc_width',
+  $facets['fss_uc_width'] = array(
+    'info' => t('Apache Solr Search: Filter by width'),
+    'facet_field' => 'fss_uc_width',
     'dividable' => TRUE,
   );
-  $facets['fs_uc_height'] = array(
-    'info' => t('Apache Solr Search: Filter by Height'),
-    'facet_field' => 'fs_uc_height',
+  $facets['fss_uc_height'] = array(
+    'info' => t('Apache Solr Search: Filter by height'),
+    'facet_field' => 'fss_uc_height',
     'dividable' => TRUE,
   );
+  
+  if (module_exists('uc_attributes')) {
+    $types = uc_product_types();
+    foreach ($types as $type_id => $type) {
+      $attributes = apachesolr_ubercart_uc_get_attributes();
+
+      foreach ($attributes as $attribute) {
+        $solr_index_name ="sm_uc_attribute_".$attribute->aid;
+        $facets[$solr_index_name] = array(
+          'info' => t('Apache Solr Search: Filter by attribute @attribute', array('@attribute' => $attribute->name)),
+          'facet_field' => $solr_index_name,
+        );
+      }
+    }
+  }
+  
   return $facets;
 }
 
+
 /**
- * Implementation of hook_block().
+ * Implementation of hook_facetapi_facet_info().
  */
-function apachesolr_ubercart_block($op = 'list', $delta = 0, $edit = array()) {
-
-  switch ($op) {
-    case 'list':
-      $enabled_facets = apachesolr_get_enabled_facets('apachesolr_ubercart');
-      $facets = apachesolr_ubercart_apachesolr_facets();
-      // Add the blocks
-      $blocks = array();
-      foreach ($enabled_facets as $delta => $facet_field) {
-        if (isset($facets[$delta])) {
-          $blocks[$delta] = $facets[$delta] + array('cache' => BLOCK_CACHE_PER_PAGE,);
-        }
+
+function apachesolr_ubercart_facetapi_facet_info($searcher_info) {
+  $facets = array();
+  //ubercart list prices
+  $facets['fss_uc_sell_price'] = array(
+    'label' => t('Sell Price'),
+    'description' => t('Apache Solr Search: Filter by Price (Selling price)'),
+    'field' => 'fss_uc_sell_price',
+  );
+  $facets['fss_uc_list_price'] = array(
+    'label' => t('List Price'), 
+    'description' => t('Apache Solr Search: Filter by Price (Listed price)'),
+    'field' => 'fss_uc_list_price',
+  );
+  $facets['ss_uc_sku'] = array(
+    'label' => t('Model'),
+    'description' => t('Apache Solr Search: Filter by Model)'),
+    'field' => 'ss_uc_sku',
+  );
+  $facets['fss_uc_weight'] = array(
+    'label' => t('Weight'), 
+    'description' => t('Apache Solr Search: Filter by weight'),
+    'field' => 'fss_uc_weight',
+  );
+  $facets['fss_uc_length'] = array(
+    'label' => t('Length'), 
+    'description' => t('Apache Solr Search: Filter by length'),
+    'field' => 'fss_uc_length',
+  );
+  $facets['fss_uc_width'] = array(
+    'label' => t('Width'), 
+    'description' => t('Apache Solr Search: Filter by width'),
+    'field' => 'fss_uc_width',
+  );
+  $facets['fss_uc_height'] = array(
+    'label' => t('Height'),
+    'description' => t('Apache Solr Search: Filter by height'),
+    'field' => 'fss_uc_height',
+  );
+  
+  if (module_exists('uc_attributes')) {
+    $types = uc_product_types();
+    foreach ($types as $type_id => $type) {
+      $attributes = apachesolr_ubercart_uc_get_attributes();
+
+      foreach ($attributes as $attribute) {
+        $solr_index_name ="sm_uc_attribute_".$attribute->aid;
+        $facets[$solr_index_name] = array(
+          'info' => t('Apache Solr Search: Filter by attribute @attribute', array('@attribute' => $attribute->name)),
+          'facet_field' => $solr_index_name,
+        );
       }
-      return $blocks;
-    case 'configure':
-      $facets = apachesolr_ubercart_apachesolr_facets();
-      $form = array();
-      if (array_key_exists($delta, $facets)) {
-        if($facets[$delta]['dividable']) {
-         $form['apachesolr_ubercart_division'] = array(
-           '#type' => 'textfield',
-           '#title' => t('The division of the price block (split all our prices by 20 for example'),
-           '#default_value' => variable_get('apachesolr_ubercart_division_'.$delta,20),
-         );
-        }
+    }
+  }
+  return $facets;
+}
+
+/**
+ * Implements hook_block_info().
+ */
+ 
+function apachesolr_ubercart_block_info() {
+
+  $searcher_info = apachesolr_facetapi_searcher_info();
+
+  $enabled_facets = array();
+  foreach (array_keys($searcher_info) as $searcher) {
+    $enabled_facets = array_merge(facetapi_get_enabled_facets($searcher), $enabled_facets);
+  }
+  $facets = apachesolr_ubercart_apachesolr_facets();
+
+  // Add the blocks
+  $blocks = array();
+  foreach ($enabled_facets as $delta => $facet_field) {
+    if (isset($facets[$delta])) {
+      $blocks[$delta] = $facets[$delta] + array('cache' => BLOCK_CACHE_PER_PAGE);
+    }
+  }
+  return $blocks;
+}
+
+/**
+ * Implements hook_block_configure().
+ */
+
+function apachesolr_ubercart_block_configure($delta) {
+  $facets = apachesolr_ubercart_apachesolr_facets();
+  $form = array();
+  if (array_key_exists($delta, $facets)) {
+    if ($facets[$delta]['dividable']) {
+      $form['apachesolr_ubercart_division'] = array(
+        '#type' => 'textfield',
+        '#title' => t('The division of the price block (split all our prices by 20 for example'),
+        '#default_value' => variable_get('apachesolr_ubercart_division_' . $delta, 20),
+      );
+    }
+  }
+  return $form;
+}
+
+/**
+ * Implements hook_block_save().
+ */
+ 
+function apachesolr_ubercart_block_save($delta, $edit) {
+  $facets = apachesolr_ubercart_apachesolr_facets();
+  if (array_key_exists($delta, $facets)) {
+    if ($facets[$delta]['dividable']) {
+      variable_set('apachesolr_ubercart_division_' . $delta, (int) $edit['apachesolr_ubercart_division']);
+    }
+  }
+}
+
+/**
+ * Implements hook_block_view().
+ */
+ 
+function apachesolr_ubercart_block_view($delta) {
+  $searcher_info = array_keys(apachesolr_facetapi_searcher_info());
+   foreach($searcher_info as $searcher) {
+    if (apachesolr_has_searched($searcher, TRUE)) {
+
+      // Get the query and response. Without these no blocks make sense.
+      $query = apachesolr_current_query($searcher);
+      $response = apachesolr_static_response_cache($searcher);
+      
+      if (empty($response)) {
+        continue;
       }
-      return $form;
-    case 'save':
-      $facets = apachesolr_ubercart_apachesolr_facets();
-      if(array_key_exists($delta,$facets)) {
-        if($facets[$delta]['dividable']) {
-          variable_set('apachesolr_ubercart_division_'.$delta, (int) $edit['apachesolr_ubercart_division']);
-        }
+
+      $facets = facetapi_get_enabled_facets($searcher);
+      if (empty($facets[$delta]) && ($delta != 'currentsearch')) {
+        continue;
       }
-      break;
-    case 'view':
-      if (apachesolr_has_searched()) {
-        // Get the query and response. Without these no blocks make sense.
-        $response = apachesolr_static_response_cache();
-        if (empty($response)) {
-          return;
-        }
-        $query = apachesolr_current_query();
-        $facets = apachesolr_get_enabled_facets('apachesolr_ubercart');
-        if (empty($facets[$delta]) && ($delta != 'currentsearch')) {
-          return;
-        }
 
-        // Get information needed by the taxonomy blocks about limits.
-        $initial_limits = variable_get('apachesolr_facet_query_initial_limits', array());
-        $limit_default = variable_get('apachesolr_facet_query_initial_limit_default', 10);
-        $division = variable_get('apachesolr_apachesolr_ubercart_division_' . $delta, 20);
-        switch ($delta) {
-          case 'fs_uc_sell_price':
-            return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by price'),$division);
-          case 'fs_uc_list_price':
-            return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by price'),$division);
-          case 'ss_uc_sku':
-            return apachesolr_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by product ID'));
-          case 'fs_uc_weight':
-            return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by weight'),$division);
-          case 'fs_uc_length':
-            return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by length'),$division);
-          case 'fs_uc_width':
-            return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by width'),$division);
-          case 'fs_uc_height':
-            return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by height'),$division);
-        }
-        break;
+      // Get information needed by the taxonomy blocks about limits.
+      $initial_limits = variable_get('apachesolr_facet_query_initial_limits', array());
+      $limit_default = variable_get('apachesolr_facet_query_initial_limit_default', 10);
+      $division = variable_get('apachesolr_apachesolr_ubercart_division_' . $delta, 20);
+      switch ($delta) {
+        case 'fss_uc_sell_price':
+          return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by price'), $division);
+        case 'fss_uc_list_price':
+          return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by price'), $division);
+        case 'ss_uc_sku':
+          return apachesolr_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by product ID'));
+        case 'fss_uc_weight':
+          return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by weight'), $division);
+        case 'fss_uc_length':
+          return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by length'), $division);
+        case 'fss_uc_width':
+          return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by width'), $division);
+        case 'fss_uc_height':
+          return apachesolr_ubercart_price_facet_block($response, $query, 'apachesolr_ubercart', $delta, $delta, t('Filter by height'), $division);
       }
       break;
+    }  
   }
 }
 
+
 /**
  * Helper function for displaying a facet block based on prices.
  *
@@ -159,33 +290,33 @@ function apachesolr_ubercart_block($op = 'list', $delta = 0, $edit = array()) {
  * We should reuse more code, that means apachesolr_facet_block() should be
  * properly abstracted.
  */
-function apachesolr_ubercart_price_facet_block($response, $query, $module, $delta, $facet_field, $filter_by, $division, $facet_callback = FALSE) {
 
+function apachesolr_ubercart_price_facet_block($response, $query, $module, $delta, $facet_field, $filter_by, $division, $facet_callback = FALSE) {
   if (!empty($response->facet_counts->facet_fields->$facet_field)) {
 
     $contains_active = FALSE;
     $items = array();
 
     // Construct our facet link amounts.
-    if(!empty($response->facet_counts->facet_fields->$delta)) {
+    if (!empty($response->facet_counts->facet_fields->$delta)) {
       $links = array();
-      foreach($response->facet_counts->facet_fields->$delta as $price => $count){
+      foreach ($response->facet_counts->facet_fields->$delta as $price => $count) {
 
         // we use Intval to filter on our divisions.
-        $divide  = intval($price/$division);
-        $links[$divide] += $count ;
+        $divide  = intval($price / $division);
+        $links[$divide] += $count;
       }
     }
 
     // Iterate over the available facet links.
-    foreach($links as $price_range => $count) {
+    foreach ($links as $price_range => $count) {
       $sortpre = 1000000 - $count;
       $options = array();
       $exclude = FALSE;
       $from_price = $price_range * $division;
       $to_price = ($price_range * $division) + $division;
-      $facet_text = t('from @price_from to @price_to',array('@price_from'=>$from_price,'@price_to'=>$to_price));
-      $facet = '['.$from_price.' TO '.$to_price.']';
+      $facet_text = t('from @price_from to @price_to', array('@price_from' => $from_price, '@price_to' => $to_price));
+      $facet = '[' . $from_price . ' TO ' . $to_price . ']';
       $unclick_link = '';
       $active = FALSE;
       $new_query = clone $query;
@@ -196,11 +327,13 @@ function apachesolr_ubercart_price_facet_block($response, $query, $module, $delt
         $sortpre = '*';
         $new_query->remove_filter($facet_field, $facet);
         $options['query'] = $new_query->get_url_queryvalues();
+        // TODO Please change this theme call to use an associative array for the $variables parameter.
         $link = theme('apachesolr_unclick_link', $facet_text, $new_query->get_path(), $options);
       }
       else {
         $new_query->add_filter($facet_field, $facet, $exclude);
         $options['query'] = $new_query->get_url_queryvalues();
+        // TODO Please change this theme call to use an associative array for the $variables parameter.
         $link = theme('apachesolr_facet_link', $facet_text, $new_query->get_path(), $options, $count, $active, $response->response->numFound);
       }
       if ($count || $active) {
@@ -214,6 +347,7 @@ function apachesolr_ubercart_price_facet_block($response, $query, $module, $delt
       // Get information needed by the rest of the blocks about limits.
       $initial_limits = variable_get('apachesolr_facet_query_initial_limits', array());
       $limit = isset($initial_limits[$module][$delta]) ? $initial_limits[$module][$delta] : variable_get('apachesolr_facet_query_initial_limit_default', 10);
+      // TODO Please change this theme call to use an associative array for the $variables parameter.
       $output = theme('apachesolr_facet_list', $items, $limit);
       return array('subject' => $filter_by, 'content' => $output);
     }
@@ -221,25 +355,83 @@ function apachesolr_ubercart_price_facet_block($response, $query, $module, $delt
   return NULL;
 }
 
+
 /**
- * Implementation of hook_apachesolr_prepare_query();
+ * Implements hook_apachesolr_query_prepare()
  */
-function apachesolr_ubercart_apachesolr_prepare_query(&$query) {
-  $query->set_available_sort('fs_uc_sell_price', array(
-    'title' => t('Price'),
+ 
+function apachesolr_ubercart_apachesolr_query_prepare(&$query) {
+  
+  $query->setAvailableSort('fss_uc_sell_price', array(
+    'title' => t('Sell Price'),
+    'default' => 'asc',
+  ));
+  $query->setAvailableSort('fss_uc_list_price', array(
+    'title' => t('List Price'),
+    'default' => 'asc',
+  ));
+  $query->setAvailableSort('fss_common_num_sold', array(
+    'title' => t('Sold times'),
+    'default' => 'asc',
+  ));
+  $query->setAvailableSort('fss_uc_weight', array(
+    'title' => t('Weight'),
+    'default' => 'asc',
+  ));
+  $query->setAvailableSort('fss_uc_width', array(
+    'title' => t('Width'),
+    'default' => 'asc',
+  ));
+  $query->setAvailableSort('fss_uc_height', array(
+    'title' => t('Height'),
+    'default' => 'asc',
+  ));
+  $query->setAvailableSort('fss_uc_position', array(
+    'title' => t('Position'),
     'default' => 'asc',
   ));
 }
 
 /**
- * Implementation of hook_theme().
+ * Implementation of hook_ca_predicate().
+ * Definition of our statistics updater
  */
-function apachesolr_ubercart_theme() {
-  return array(
-    'apachesolr_ubercart_breadcrumb_fs_uc_sell_price' => array(
-      'arguments' => array('type' => 'test'),
+function apachesolr_ubercart_ca_predicate() {
+  $predicates = array();
+
+  $predicates['apachesolr_ubercart_update_stats'] = array(
+    '#title' => t('Update statistics'),
+    '#description' => t('Update the statistics for the most sold in Solr by changing the products date.'),
+    '#class' => 'apachesolr_ubercart',
+    '#status' => 1,
+    '#trigger' => 'uc_checkout_complete',
+    '#actions' => array(
+      array(
+        '#name' => 'apachesolr_ubercart_set_stats_in_node',
+        '#title' => t('Update the changed date in the node'),
+        '#argument_map' => array(
+          'order' => 'order',
+        ),
+      ),
     ),
   );
+  return $predicates;
+}
+
+
+
+function apachesolr_ubercart_uc_get_attributes() {
+  $attributes = array();
+  $result = db_query("SELECT ua.aid FROM {uc_attributes} AS ua ORDER BY ua.ordering, ua.name");
+  while ($attribute = db_fetch_object($result)) {
+    $attributes[$attribute->aid] = uc_attribute_load($attribute->aid, $pcid, 'class');
+  }
+  return $attributes;
+}
+
+function apachesolr_ubercart_attribute_to_name($facet, $options) {
+  $option = uc_attribute_option_load($facet);
+  return $option->name;
 }
 
 /**
@@ -248,3 +440,53 @@ function apachesolr_ubercart_theme() {
 function apachesolr_ubercart_views_api() {
   return array('api' => '3.0-dev');
 }
+
+/**
+ * Implementation of hook_apachesolr_theme_breadcrumb_alter().
+ */
+function apachesolr_ubercart_apachesolr_theme_breadcrumb_alter(&$fieldname) {
+  switch ($fieldname) {
+    case 'apachesolr_breadcrumb_fs_uc_list_price':
+    case 'apachesolr_breadcrumb_fs_uc_sell_price':
+      $fieldname = 'apachesolr_ubercart_breadcrumb_uc_price';
+      break;
+  }
+  if (strpos($fieldname, '_sm_uc_attribute_')) {
+    $fieldname = 'apachesolr_ubercart_breadcrumb_uc_attribute_option';
+  }
+}
+
+
+/**
+ * Implementation of hook_theme().
+ */
+function apachesolr_ubercart_theme() {
+  return array(
+    'apachesolr_ubercart_breadcrumb_uc_attribute_option' => array(
+      'arguments' => array('field' => NULL),
+    ),
+    'apachesolr_ubercart_breadcrumb_uc_price' => array(
+      'arguments' => array('field' => NULL),
+    ),
+  );
+}
+
+/**
+ * Return the human readable value of an attribute option.
+ */
+function theme_apachesolr_ubercart_breadcrumb_uc_attribute_option($field) {
+  return apachesolr_ubercart_attribute_to_name($field['#value'], NULL);
+}
+
+/**
+ * Return the human readable value of a price range.
+ */
+function theme_apachesolr_ubercart_breadcrumb_uc_price($field) {
+  $context = array('revision' => 'formatted', 'type' => 'product');
+  return t('from @price_from to @price_to',
+    array(
+      '@price_from' => uc_price($field['#start'], $context),
+      '@price_to' => uc_price($field['#end'], $context)
+    )
+  );
+}
diff --git a/apachesolr_ubercart.views.inc b/apachesolr_ubercart.views.inc
index c3b9ca1..eafba5c 100644
--- a/apachesolr_ubercart.views.inc
+++ b/apachesolr_ubercart.views.inc
@@ -1,88 +1,88 @@
-<?php
-/**
- * Implementation of hook_views_data_alter()
- *
- * Exposes Ubercart fields and sorts to apachesolr views
- */
-function apachesolr_ubercart_views_data_alter(&$data) {
-  $data['apachesolr_node']['fs_uc_sell_price'] = array(
-    'title' => t('Product Sell Price'),
-    'help' => t('Product Sell Price'),
-    'argument' => array(
-      'handler' => 'apachesolr_views_handler_argument',
-    ),
-    'sort' => array(
-      'handler' => 'apachesolr_views_handler_sort',
-    ),
-  );
-  $data['apachesolr_node']['fs_uc_list_price'] = array(
-    'title' => t('Product List Price'),
-    'help' => t('Product List Price'),
-    'argument' => array(
-      'handler' => 'apachesolr_views_handler_argument',
-    ),
-    'sort' => array(
-      'handler' => 'apachesolr_views_handler_sort',
-    ),
-  );
-  $data['apachesolr_node']['ss_uc_sku'] = array(
-    'title' => t('Product Model (SKU)'),
-    'help' => t('Product Model'),
-    'argument' => array(
-      'handler' => 'apachesolr_views_handler_argument',
-    ),
-    'sort' => array(
-      'handler' => 'apachesolr_views_handler_sort',
-    ),
-  );
-  $data['apachesolr_node']['fs_uc_weight'] = array(
-    'title' => t('Product Weight'),
-    'help' => t('Product Weight'),
-    'argument' => array(
-      'handler' => 'apachesolr_views_handler_argument',
-    ),
-    'sort' => array(
-      'handler' => 'apachesolr_views_handler_sort',
-    ),
-  );
-  $data['apachesolr_node']['fs_uc_length'] = array(
-    'title' => t('Product Length'),
-    'help' => t('Product Length'),
-    'argument' => array(
-      'handler' => 'apachesolr_views_handler_argument',
-    ),
-    'sort' => array(
-      'handler' => 'apachesolr_views_handler_sort',
-    ),
-  );
-  $data['apachesolr_node']['fs_uc_width'] = array(
-    'title' => t('Product Width'),
-    'help' => t('Product Width'),
-    'argument' => array(
-      'handler' => 'apachesolr_views_handler_argument',
-    ),
-    'sort' => array(
-      'handler' => 'apachesolr_views_handler_sort',
-    ),
-  );
-  $data['apachesolr_node']['fs_uc_height'] = array(
-    'title' => t('Product Height'),
-    'help' => t('Product Height'),
-    'argument' => array(
-      'handler' => 'apachesolr_views_handler_argument',
-    ),
-    'sort' => array(
-      'handler' => 'apachesolr_views_handler_sort',
-    ),
-  );
-  $data['apachesolr_node']['fs_uc_position'] = array(
-    'title' => t('Product List Position'),
-    'help' => t('Product List Position'),
-    'argument' => array(
-      'handler' => 'apachesolr_views_handler_argument',
-    ),
-    'sort' => array(
-      'handler' => 'apachesolr_views_handler_sort',
-    ),
-  );
-}
+<?php
+/**
+ * Implementation of hook_views_data_alter()
+ *
+ * Exposes Ubercart fields and sorts to apachesolr views
+ */
+function apachesolr_ubercart_views_data_alter(&$data) {
+  $data['apachesolr_node']['fss_uc_sell_price'] = array(
+    'title' => t('Product Sell Price'),
+    'help' => t('Product Sell Price'),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr_node']['fss_uc_list_price'] = array(
+    'title' => t('Product List Price'),
+    'help' => t('Product List Price'),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr_node']['ss_uc_sku'] = array(
+    'title' => t('Product Model (SKU)'),
+    'help' => t('Product Model'),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr_node']['fss_uc_weight'] = array(
+    'title' => t('Product Weight'),
+    'help' => t('Product Weight'),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr_node']['fss_uc_length'] = array(
+    'title' => t('Product Length'),
+    'help' => t('Product Length'),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr_node']['fss_uc_width'] = array(
+    'title' => t('Product Width'),
+    'help' => t('Product Width'),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr_node']['fss_uc_height'] = array(
+    'title' => t('Product Height'),
+    'help' => t('Product Height'),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr_node']['fss_uc_position'] = array(
+    'title' => t('Product List Position'),
+    'help' => t('Product List Position'),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+}
