commerce_product_types

  1. commerce
    1. 7
Versions
7 commerce_product_types()

Returns an array of product type arrays keyed by type.

▾ 17 functions call commerce_product_types()

CommerceProductCRUDTestCase::testCommerceProductDefaultProducts in modules/product/tests/commerce_product.test
Ensure the default product types are created.
CommerceProductCRUDTestCase::testCommerceProductTypeCrud in modules/product/tests/commerce_product.test
Test the product type CRUD functions.
CommerceProductUIAdminTest::setUp in modules/product/tests/commerce_product_ui.test
Implementation of setUp().
CommerceProductUIAdminTest::testCommerceProductUIAccessProductTypes in modules/product/tests/commerce_product_ui.test
Test the access to the product types listing page.
CommerceProductUIAdminTest::testCommerceProductUIAddProductType in modules/product/tests/commerce_product_ui.test
Test adding a new product type.
CommerceProductUIAdminTest::testCommerceProductUIDeleteProductType in modules/product/tests/commerce_product_ui.test
Delete a product type.
CommerceProductUIAdminTest::testCommerceProductUIDeleteProductTypeWithProducts in modules/product/tests/commerce_product_ui.test
Delete a product type that already has products.
CommerceProductUIAdminTest::testCommerceProductUIEditProductType in modules/product/tests/commerce_product_ui.test
Edit a product type.
commerce_product_configure_product_types in modules/product/commerce_product.module
Configure the product types defined by enabled modules.
commerce_product_field_extra_fields in modules/product/commerce_product.module
Implements hook_field_extra_fields().
commerce_product_type_get_name in modules/product/commerce_product.module
Returns the human readable name of any or all product types.
commerce_product_type_load in modules/product/commerce_product.module
Loads a product type.
commerce_product_ui_admin_menu_map in modules/product/commerce_product_ui.module
Implements hook_admin_menu_map().
commerce_product_ui_menu in modules/product/commerce_product_ui.module
Implements hook_menu().
commerce_product_ui_menu_alter in modules/product/commerce_product_ui.module
Implements hook_menu_alter().
commerce_product_ui_product_add_any_access in modules/product/commerce_product_ui.module
Access callback: determines if the user can create any type of product.
commerce_product_ui_types_overview in modules/product/includes/commerce_product_ui.types.inc
Menu callback: display an overview of available types.

Code

modules/product/commerce_product.module, line 348

<?php
function commerce_product_types() {
  // First check the static cache for a product types array.
  $product_types = &drupal_static(__FUNCTION__);

  // If it did not exist, fetch the types now.
  if (!isset($product_types)) {
    $product_types = array();

    // Find product types defined by hook_commerce_product_type_info().
    foreach (module_implements('commerce_product_type_info') as $module) {
      foreach (module_invoke($module, 'commerce_product_type_info') as $type => $product_type) {
        // Set the module each product type is defined by if it isn't set yet.
        $product_type += array('module' => $module);
        $product_types[$type] = $product_type;
      }
    }

    // Last allow the info to be altered by other modules.
    drupal_alter('commerce_product_type_info', $product_types);
  }

  return $product_types;
}
?>