You are here

function commerce_product_handler_field_product::render_link in Commerce Core 7

Render whatever the data is as a link to the product.

Data should be made XSS safe prior to calling this function.

2 calls to commerce_product_handler_field_product::render_link()
commerce_product_handler_field_product::render in modules/product/includes/views/handlers/commerce_product_handler_field_product.inc
Render the field.
commerce_product_handler_field_product_type::render in modules/product/includes/views/handlers/commerce_product_handler_field_product_type.inc
Render the field.

File

modules/product/includes/views/handlers/commerce_product_handler_field_product.inc, line 47
Contains the basic product field handler.

Class

commerce_product_handler_field_product
Field handler to provide simple renderer that allows linking to a product.

Code

function render_link($data, $values) {
  if (!empty($this->options['link_to_product']) && $data !== NULL && $data !== '') {
    $product_id = $this
      ->get_value($values, 'product_id');
    $this->options['alter']['make_link'] = TRUE;
    $this->options['alter']['path'] = 'admin/commerce/products/' . $product_id;
  }
  return $data;
}