You are here

function commerce_gc_product_install in Commerce GC 7

File

modules/commerce_gc_product/commerce_gc_product.install, line 91
Installs default giftcard product fields.

Code

function commerce_gc_product_install() {

  // Add the giftcard product product type
  // Create the basic product type.
  drupal_load('module', 'commerce_product_ui');
  if (!commerce_product_type_load('giftcard')) {
    $product_type = commerce_product_ui_product_type_new();
    $product_type['type'] = 'giftcard';
    $product_type['name'] = t('Giftcard');
    $product_type['description'] = t('This product generates a giftcard when purchased.');
    $product_type['is_new'] = TRUE;
    commerce_product_ui_product_type_save($product_type, FALSE);
    _commerce_gc_product_install_helper();
  }
}