function commerce_product_ui_product_uri in Commerce Core 7
Entity uri callback: points to the edit form of the given product if no other URI is specified.
1 string reference to 'commerce_product_ui_product_uri'
- commerce_product_ui_entity_info_alter in modules/
product/ commerce_product_ui.module - Implements hook_entity_info_alter().
File
- modules/
product/ commerce_product_ui.module, line 281
Code
function commerce_product_ui_product_uri($product) {
// First look for a return value in the default entity uri callback.
$uri = commerce_product_uri($product);
// If a value was found, return it now.
if (!empty($uri)) {
return $uri;
}
// Otherwise return an admin URI if the user has permission.
if (commerce_product_access('update', $product)) {
return array(
'path' => 'admin/commerce/products/' . $product->product_id,
);
}
return NULL;
}