Functions:userAccountAndAddressCreate

From Whirlwind eCommerce Wiki
Revision as of 03:24, 5 November 2008 by 71.163.185.8 (Talk)

Jump to: navigation, search

Description

Controls a new user/address form, adds a new user/address. Use this function to build a 'create account' page.

Syntax

$accountArray = eV::userAccountAndAddressCreate($fieldList,$redirect);

Paramaters

  • $fieldList STRING
Comma separated list of fields to be managed by the form.
Available fields to place in $fieldList:
  • Address Fields
  • address_firstName
  • address_lastName
  • address_company
  • addressName
  • street1
  • street2
  • city
  • state
  • state_alt
  • zipCode
  • country
  • phone1
  • phone2
  • phone3
  • fax
  • User Account Fields
  • firstName
  • lastName
  • password
  • passwordConfirm
  • userNotes
  • company
  • title
  • Other Fields
  • subscribe: if set to 1, newsletter registration process will be initiated for the passed emailAddress
  • captcha: verifies captcha validation has been passed
  • custom_field_...: any number of custom user fields can be passed, but must be set up in Settings in User Management.
The listed fields in $fieldList can be complimented with the following field controls:
  • /min:#:message
  • /max:#:message
  • /default:value
  • /email:message
  • /unique:message
example use of controls in $fieldList: ""
  • $redirect STRING
URL where visitor will be forwarded to following a successful form submission

Return Values

Multidimensional array of field values and error messages containing [message]: a string containing any error messages that prohibited the form data from being submitted, and [values]: a keyed array of fields and their values. Note that only fields specified in the $fieldList attribute will be contained in the [value] array:

Array
(
    [message] => STRING
    [values] => ARRAY
        (
           //Address Fields
           [address_firstName] => STRING
           [address_lastName] => STRING
           [address_company] => STRING
           [addressName] => STRING
           [street1] => STRING
           [street2] => STRING
           [city] => STRING
           [state] => STRING
           [state_alt] => STRING
           [zipCode] => STRING
           [country] => STRING
           [phone1] => STRING
           [phone2] => STRING
           [phone3] => STRING
           [fax] => STRING
           //User Account Fields
           [firstName] => STRING
           [lastName] => STRING
           [password] => STRING
           [passwordConfirm] => STRING
           [userNotes] => STRING
           [company] => STRING
           [title] => STRING
           //Custom Fields
           [custom_field_...] => STRING
           ...
        )
)

Examples

example 1

example 1 goes here

example 2

example 2 goes here

See Also