You are here

function commerce_addressbook_profile_create in Commerce Addressbook 7.3

Same name and namespace in other branches
  1. 7.2 includes/commerce_addressbook.user.inc \commerce_addressbook_profile_create()

Page callback for creating a customer profile of a given type.

1 string reference to 'commerce_addressbook_profile_create'
commerce_addressbook_menu in ./commerce_addressbook.module
Implements hook_menu().

File

includes/commerce_addressbook.user.inc, line 11
Page callbacks and form callbacks for user addressbook pages.

Code

function commerce_addressbook_profile_create($account, $profile_type) {

  // Add the breadcrumb for the form's location.
  commerce_addressbook_set_breadcrumb($account, $profile_type);
  $profile = commerce_customer_profile_new($profile_type, $account->uid);

  // The submit handler needs an indication that the profile was just added.
  // The regular is_new property gets unset after save is complete.
  $profile->_is_new = TRUE;
  module_load_include('inc', 'commerce_customer', 'includes/commerce_customer_profile.forms');
  return drupal_get_form('commerce_addressbook_customer_profile_form', $profile);
}