For the complete documentation index, see llms.txt. This page is also available as Markdown.

Customer Helper Functions

The helper you can use to create, delete, get and update Customer details.

function add_customer($customer) {.....}

Supported hooks

Filter name: before_add_customer Description: This filter would be executed before add customer into the database in add_customer helper. Usage:

// The filter callback function is based on the filter.

add_filter( ‘before_add_customer’, ‘before_add_customer_callback_fun’, 10, 1 );

function before_add_customer_callback_fun($customer) {
 // code
}

Filter name: should_add_customer Description: This filter would be executed before add customer into database in add_customer helper. Usage:

// The filter callback function is based on the filter.

add_filter( ‘should_add_customer’, ‘should_add_customer_callback_fun’, 10, 1 );

function should_add_customer_callback_fun($customer) {
    // code
}

hook name: pre.add.customer Description: This hook would be executed before add customer into the database in add_customer helper. Usage:

hook name: post.add.customer Description: This hook would be executed after add customer into the database in add_customer helper. Usage:

Usage

Request Parameters

Parameters in array format includes following attributes:

Param
Type
Required
Default
Description

customer_name

Character

Yes

Null

The customer name of a specific customer.

address

Character

Null

The address for specific customer.

city

Character

Null

The city for a specific customer.

region

Character

Null

The region for a specific customer.

country

Character

Null

The country for a specific customer.

postal_code

Character

Null

The postal_code for a specific customer.

phone

Character

Null

The phone number of a specific customer.

fax

Character

Null

The fax for a specific customer.

email

Character

Null

The email id of specific customer.

company_id

Integer

Yes

Null

The company_id for specific customer.

customer_notes

Character

Null

The customer_notes for a specific customer.

phone2

Character

Null

The phone2 second number of a specific customer.

address2

Character

Null

The address2 second address of a specific customer.

customer_type

Character

Null

The customer_type for a specific customer.

is_primary

Integer

Yes

1

The is_primary if active then customer card add as a primary card for a specific customer.

card_name

Character

Yes

Null

The card_name for a specific customer card details.

cc_number

Character

Yes

Null

The cc_number of the card for customer card details.

cvc

Character

Yes

Null

The cvc of the card for customer card details.

cc_expiry_month

Character

Yes

Null

The cc_expiry_month of the card for customer card details.

cc_expiry_year

Character

Yes

Null

The cc_expiry_year of the card for customer card details.

Response

function get_customer($customer_id) {....}

Supported hooks

Filter name: before_get_customer Description: This filter would be executed before retrieving customer details from database in get_customer helper. Usage:

Filter name: should_get_customer Description: This filter would be executed before retrieving customer details from database in get_customer helper. Usage:

hook name: pre.get.customer Description: This hook would be executed before retrieving customer details from database in get_customer helper. Usage:

hook name: post.get.customer Description: This hook would be executed after retrieving customer details from database in get_customer helper. Usage:

Usage

Request Parameters

Param
Type
Required
Default
Description

$customer_id

Integer

Yes

Null

The primary id of the customer corresponds to the customer table

Response

function get_customers($filter) {.....}

Supported hooks

Filter name: before_get_customers Description: This filter would be executed before retrieving customer details from database in get_customers helper. Usage:

Filter name: should_get_customers Description: This filter would be executed before retrieving customer details from database in get_customers helper. Usage:

hook name: pre.get.customers Description: This hook would be executed before retrieving customer details from database in get_customers helper. Usage:

hook name: post.get.customers Description: This hook would be executed after retrieving customer details from database in get_customers helper. Usage:

Usage

Request Parameters

parameter array filter required for payment details.

Param
Type
Required
Default
Description

customer_name

Character

Yes

Null

The customer name for a specific customer details.

customer_id

Integer

Yes

Null

The customer_id for a specific customer.

company_id

Integer

Yes

Null

The company_id for a specific customer.

email

Character

Yes

Null

The email for a specific customer.

Response

function update_customers($customer, $customer_id) {....}

Usage

Supported hooks

Filter name: before_update_customer Description: This filter would be executed before update customer into the database in update_customer helper. Usage:

Filter name: should_update_customer Description: This filter would be executed before update rate into database in update_rates helper. Usage:

hook name: pre.update.customer Description: This hook would be executed before update customer into the database in update_customer helper. Usage:

hook name: post.update.customer Description: This hook would be executed after update customer into the database in update_customer helper. Usage:

Request Parameters

Request required customer_id and array format data includes following attributes:

Param
Type
Required
Default
Description

customer_name

Character

Yes

Null

The customer name of a specific customer.

address

Character

Null

The address for specific customer.

city

Character

Null

The city for a specific customer.

region

Character

Null

The region for a specific customer.

country

Character

Null

The country for a specific customer.

postal_code

Character

Null

The postal_code for a specific customer.

phone

Character

Null

The phone number of a specific customer.

fax

Character

Null

The fax for a specific customer.

email

Character

Null

The email id of specific customer.

customer_notes

Character

Null

The customer_notes for a specific customer.

phone2

Character

Null

The phone2 second number of a specific customer.

address2

Character

Null

The address2 second address of a specific customer.

customer_type

Character

Null

The customer_type for a specific customer.

Response

function delete_customer($customer_id) {.....}

Usage

Request Parameters

Param
Type
Required
Default
Description

$customer_id

Integer

Yes

Null

The id of the customer corresponds to the customer table

Response

Last updated