ePages 6.11.0 - DE_EPAGES/Customer/API/Shop.pm

Package DE_EPAGES::Customer::API::Shop

This package provides shop functions of Customer.

@EXPORT_OK
GetNextCustomerNo
GetCustomerForUser
GetCustomerFolder
InsertCustomerForUser
InsertUserForCustomer

Functions

GetCustomerFolder
GetCustomerForUser
GetNextCustomerNo
InsertCustomerForUser
InsertUserForCustomer

GetCustomerFolder

Creates a customer of a shop and maps the user to customer.

Syntax
$CustomerFolder = GetCustomerFolder($Shop);
Input
$Shop (object)
shop
Return
$CustomerFolder (object)
customer folder

GetCustomerForUser

Returns the customer which maps to shop and user, if there is no customers map the function returns 'undef'.

Syntax
$Customer = GetCustomerForUser($User, $Shop);
Input
$User (object)
user
$Shop (object)
shop
Return
$Customer (object or undef)
customer

GetNextCustomerNo

Returns the next customer alias for this shop.

Syntax
$CustomerNo = GetNextCustomerNo($Shop);
Input
$Shop (object)
shop
Return
$CustomerNo (string)
alias string for customer

InsertCustomerForUser

Creates a customer of a shop and maps the user to customer.

Syntax
$Customer = InsertCustomerForUser($User, $Shop, $hCustomerData);
Input
$User (object)
user
$Shop (object)
shop
$hCustomerData (ref.hash)
additional customer attributes (optional)
Return
$Customer (object)
customer

InsertUserForCustomer

Creates a new user account for a customer. Grants permissions on all existing orders of the customer to the new user. If the customer already has an order, then the shipping address from this order is added as shipping address for the user. Does not send a welcome e-mail to the user.

Syntax
$Customer = InsertUserForCustomer($Shop, $Customer, $hUser, $hBillingAddress);
Input
$Shop (object)
shop
$Customer (object)
customer
$hUser (ref.hash)
user attributes, such as Alias and Password
$hBillingAddress (ref.hash)
billing address attributes
Return
$User (object)
user