You are here

function commerce_physical_entity_dimensions_field_name in Commerce Physical Product 7

Determines the dimensions field to use for a given entity.

Parameters

string $entity_type: The type of entity passed to the function.

object $entity: The actual entity whose weight field name should be determined.

Return value

string The name of the field to use on the entity to find a weight value or NULL if none was found.

1 call to commerce_physical_entity_dimensions_field_name()
commerce_physical_product_line_item_dimensions in ./commerce_physical.module
Determines the dimensions of a product line item on an order.

File

./commerce_physical.module, line 43
API for working with physical product types in Drupal Commerce.

Code

function commerce_physical_entity_dimensions_field_name($entity_type, $entity) {
  $field_name = commerce_physical_entity_field_name($entity_type, $entity, 'physical_dimensions');

  // Allow other modules to specify a different field name.
  drupal_alter('commerce_physical_entity_dimensions_field_name', $field_name, $entity_type, $entity);
  return $field_name;
}