commerce_product_type_load

  1. commerce
    1. 7
Versions
7 commerce_product_type_load($type)

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.

▾ 6 functions call commerce_product_type_load()

CommerceProductCRUDTestCase::testCommerceProductTypeCrud in modules/product/tests/commerce_product.test
Test the product type CRUD functions.
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.
commerce_product_ui_product_type_form_wrapper in modules/product/includes/commerce_product_ui.types.inc
Form callback wrapper: create or edit a product type.
commerce_product_ui_product_type_update_access in modules/product/commerce_product_ui.module
Access callback: determines if the user can edit or delete a product type.

Code

modules/product/commerce_product.module, line 387

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