You are here

function commerce_product_type_load in Commerce Core 7

Loads a product type.

Parameters

$type: The machine-readable name of the product type; accepts normal machine names and URL prepared machine names with underscores replaced by hyphens.

7 calls to commerce_product_type_load()
CommerceProductCRUDTestCase::testCommerceProductTypeCrud in modules/product/tests/commerce_product.test
Test the product type CRUD functions.
commerce_product_product_form in modules/product/includes/commerce_product.forms.inc
Form callback: create or edit a product.
commerce_product_ui_help in modules/product/commerce_product_ui.module
Implements hook_help().
commerce_product_ui_product_type_delete in modules/product/commerce_product_ui.module
Deletes a product type.
commerce_product_ui_product_type_delete_form_wrapper in modules/product/includes/commerce_product_ui.types.inc
Form callback wrapper: confirmation form for deleting a product type.

... See full list

1 string reference to 'commerce_product_type_load'
commerce_product_ui_product_type_form in modules/product/includes/commerce_product_ui.forms.inc
Form callback: create or edit a product type.

File

modules/product/commerce_product.module, line 418
Defines the core Commerce product entity, including the entity itself, the bundle definitions (product types), and various API functions to manage products and interact with them through forms and autocompletes.

Code

function commerce_product_type_load($type) {
  $type = strtr($type, array(
    '-' => '_',
  ));
  $product_types = commerce_product_types();
  return !empty($product_types[$type]) ? $product_types[$type] : FALSE;
}