function CommerceRegistrationHandlerFieldRegistrationEntity::render in Commerce Registration 7.2
Same name and namespace in other branches
- 7.3 includes/views/handlers/commerce_registration_handler_field_registration_entity.inc \CommerceRegistrationHandlerFieldRegistrationEntity::render()
 
Returns a link to the registration's Commerce Product.
Return value
string The HTML link to the product.
Overrides views_handler_field::render
File
- includes/
views/ handlers/ commerce_registration_handler_field_registration_entity.inc, line 21  - Commerce Registration attached entity views field handler.
 
Class
- CommerceRegistrationHandlerFieldRegistrationEntity
 - @file Commerce Registration attached entity views field handler.
 
Code
function render($values) {
  $product = commerce_product_load($values->registration_entity_id);
  if (!empty($product)) {
    $uri = entity_uri('commerce_product', $product);
    $text = t('@product (@sku)', array(
      '@product' => $product->title,
      '@sku' => $product->sku,
    ));
    return l($text, $uri['path']);
  }
}