Index: modules/price/includes/views/handlers/commerce_price_handler_join_calculated_price.inc IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- modules/price/includes/views/handlers/commerce_price_handler_join_calculated_price.inc (date 1514316507000) +++ modules/price/includes/views/handlers/commerce_price_handler_join_calculated_price.inc (date 1514316507000) @@ -0,0 +1,19 @@ +extra[] = array( + 'field' => 'module_key', + 'value' => $key, + ); + + parent::build_join($select_query, $table, $view_query); + } +} Index: modules/price/includes/views/handlers/commerce_price_handler_field_calculated_price.inc IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- modules/price/includes/views/handlers/commerce_price_handler_field_calculated_price.inc (date 1514316507000) +++ modules/price/includes/views/handlers/commerce_price_handler_field_calculated_price.inc (date 1514316507000) @@ -0,0 +1,14 @@ +get_value($values); + $currency_code = $this->get_value($values, 'currency_code'); + + return commerce_currency_format($amount, $currency_code); + } +} Index: modules/price/includes/views/commerce_price.views.inc IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- modules/price/includes/views/commerce_price.views.inc (date 1514316507000) +++ modules/price/includes/views/commerce_price.views.inc (date 1514316507000) @@ -5,6 +5,67 @@ * Provides Views integration for the commerce_price field. */ +/** + * Implements hook_views_data(). + */ +function commerce_price_views_data() { + + // Add the precalculated price fields. + $data = array(); + $valid_precalculation_fields = array('commerce_price'); + + foreach ($valid_precalculation_fields as $field_name) { + + $data['commerce_calculated_price_' . $field_name] = array( + 'table' => array( + 'group' => t("Commerce Product"), + 'help' => t("The price after applying price calculation rules."), + 'join' => array( + 'commerce_product' => array( + 'table' => 'commerce_calculated_price', + 'left_field' => 'product_id', + 'field' => 'entity_id', + 'handler' => 'commerce_price_handler_join_calculated_price', + 'field_name' => $field_name, + 'extra' => array( + array( + 'field' => 'entity_type', + 'value' => 'commerce_product', + ), + array( + 'field' => 'field_name', + 'value' => $field_name, + ), + ), + ), + ), + ), + 'price' => array( + 'title' => t("Precalculated price: @field_name", array('@field_name' => $field_name)), + 'field' => array( + 'real field' => 'amount', + 'handler' => 'commerce_price_handler_field_calculated_price', + 'click sortable' => TRUE, + 'additional fields' => array('currency_code'), + ), + ), + 'amount' => array( + 'title' => t("Precalculated price: @field_name:amount", array('@field_name' => $field_name)), + 'sort' => array( + 'handler' => 'views_handler_sort', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'commerce_price_handler_filter_commerce_price_amount', + 'allow empty' => FALSE, + ), + ), + ); + } + + return $data; +} + /** * Implements hook_field_views_data(). */ Index: modules/price/commerce_price.info IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- modules/price/commerce_price.info (date 1514316507000) +++ modules/price/commerce_price.info (date 1514316507000) @@ -9,7 +9,9 @@ ; Views handlers files[] = includes/views/handlers/commerce_price_handler_field_commerce_price.inc +files[] = includes/views/handlers/commerce_price_handler_field_calculated_price.inc files[] = includes/views/handlers/commerce_price_handler_filter_commerce_price_amount.inc +files[] = includes/views/handlers/commerce_price_handler_join_calculated_price.inc ; Information added by Drupal.org packaging script on 2017-11-16 version = "7.x-1.14"