You are here

function commerce_pricelist_item_add in Commerce Pricelist 7

Provides a wrapper on the edit form to add a new entity.

1 string reference to 'commerce_pricelist_item_add'
commerce_pricelist_menu in ./commerce_pricelist.module
Implements hook_menu().

File

includes/commerce_pricelist.admin.inc, line 725
Summary

Code

function commerce_pricelist_item_add($product = NULL) {

  // Create a basic entity structure to be used and passed to the validation
  // and submission functions.
  $sku = NULL;
  if ($product != NULL) {
    $sku = $product->sku;
  }
  $entity = commerce_pricelist_item_new(NULL, $sku);
  return drupal_get_form('commerce_pricelist_item_form', $entity);
}