diff --git a/modules/product/includes/views/handlers/commerce_product_handler_field_product_link.inc b/modules/product/includes/views/handlers/commerce_product_handler_field_product_link.inc index 67cb3ca..bddcbae 100644 --- a/modules/product/includes/views/handlers/commerce_product_handler_field_product_link.inc +++ b/modules/product/includes/views/handlers/commerce_product_handler_field_product_link.inc @@ -3,7 +3,7 @@ /** * Field handler to present a link to a product. */ -class commerce_product_handler_field_product_link extends views_handler_field { +class commerce_product_handler_field_product_link extends views_handler_field_url { function construct() { parent::construct(); @@ -33,10 +33,18 @@ class commerce_product_handler_field_product_link extends views_handler_field { $this->add_additional_fields(); } - function render($values) { - $text = !empty($this->options['text']) ? $this->options['text'] : t('view'); + /** + * {@inheritdoc} + */ + function get_value($values, $field = NULL) { + if (!is_null($field)) { + return parent::get_value($values, $field); + } + $product_id = $this->get_value($values, 'product_id'); + $product = commerce_product_load($product_id); + $uri = entity_uri('commerce_product', $product); - return l($text, 'admin/commerce/products/' . $product_id); + return url($uri['path'], $uri['options']); } }