You are here

function commerce_product_entity_property_info_alter in Commerce Core 7

Implements hook_entity_property_info_alter() on top of the Product module.

File

modules/product/commerce_product.info.inc, line 118
Provides metadata for the product entity.

Code

function commerce_product_entity_property_info_alter(&$info) {

  // Move the default price property to the product by default; as it is a
  // required default field, this makes dealing with it more convenient.
  $properties = array();
  foreach ($info['commerce_product']['bundles'] as $bundle => $bundle_info) {
    $bundle_info += array(
      'properties' => array(),
    );
    $properties += $bundle_info['properties'];
  }
  if (!empty($properties['commerce_price'])) {
    $info['commerce_product']['properties']['commerce_price'] = $properties['commerce_price'];
  }
}