commerce_product_configure_product_fields

  1. commerce
    1. 7
Versions
7 commerce_product_configure_product_fields($modules = NULL)

Configures the fields on product types provided by other modules.

Parameters

$modules An array of module names whose product type fields should be configured; if left NULL, will default to all modules that implement hook_commerce_product_type_info().

Code

modules/product/commerce_product.module, line 324

<?php
function commerce_product_configure_product_fields($modules = NULL) {
  // If no modules array is passed, recheck the fields for all product types
  // defined by enabled modules.
  if (empty($modules)) {
    $modules = module_implements('commerce_product_type_info');
  }

  // Loop through all the enabled modules.
  foreach ($modules as $module) {
    // If the module implements hook_commerce_product_type_info()...
    if (module_hook($module, 'commerce_product_type_info')) {
      $product_types = module_invoke($module, 'commerce_product_type_info');

      // Loop through and configure the product types defined by the module.
      foreach ($product_types as $type => $product_type) {
        commerce_product_configure_product_type($type);
      }
    }
  }
}
?>