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

Rate Plan Helper Functions

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

function get_rate_plan($rate_plan_id) {....}

Supported hooks

Filter name: before_get_rate_plan Description: This filter would be executed before retrieving rate_plan details from database in get_rate_plan helper. Usage:

 add_filter('before_get_rate_plan', 'before_get_rate_plan_callback_fn', 10, 1);
 
 function before_get_rate_plan_callback_fn ($rate_plan_id) {
   // This filter would be executed before retrieving rate_planfrom database in get_rate_plan helper.
 }

Filter name: should_get_rate_plan Description: This filter would be executed before retrieving rate_plan details from database in get_rate_plan helper. Usage:

add_filter('should_get_rate_plan', 'should_get_rate_plan_callback_fn', 10, 1);

 function should_get_rate_plan_callback_fn ($rate_plan_id) {
   // This filter would be executed before retrieving rate_plan details from database in get_rate_plan helper.
 }

Hook name : pre.get.rate_plan Description: This hook would be executed before retrieving rate_plan details from database in get_rate_plan helper. Usage:

add_filter('pre.get.rate_plan', 'pre_get_rate_plan_callback_fn', 10, 1);

 function pre_get_rate_plan_callback_fn ($rate_plan_id) {
   // This filter would be executed before retrieving rate_plan details from database in get_rate_plan helper.
 }

Hook name : post.get.rate_plan Description: This hook would be executed after retrieving rate_plan details from database in get_rate_plan helper. Usage:

Usage

Request Parameters

Param
Type
Required
Default
Description

$rate_plan_id

integer

yes

null

The id of the rate plan corresponds to the rate plan table

Response

function add_rate_plan($rate_plan) {.....}

Supported hooks

Filter name: before_add_rate_plan Description: This filter would be executed before add rate plan into the database in add_rate_plan helper. Usage:

Filter name: should_add_rate_plan Description: This filter would be executed before add rate plan into database in add_rate_plan helper. Usage:

hook name: pre.add.rate_plan Description: This hook would be executed before add rate plan into the database in add_rate_plan helper. Usage:

hook name: post.add.rate_plan Description: This hook would be executed after add rate plan into the database in add_rate_plan helper. Usage:

Usage

Request Parameters

Parameters in array format includes following attributes:

Param
Type
Required
Default
Description

rate_plan_name

Character

Yes

Null

The rate_plan_name of specific rate_plan.

room_type_id

Integer

0

The room_type_id for specific rate_plan.

charge_type_id

Integer

0

The charge_type_id for specific rate_plan.

description

Text

Null

The description of specific rate_plan.

number_of_adults_included_for_base_rate

Integer

4

The number of adults included for base_rate in a rate plan.

currency_id

Integer

Null

The currency_id for specific rate_plan.

base_rate_id

Integer

Null

The base_rate_id for specific rate_plan.

is_selectable

Integer

1

The is_selectable for specific rate_plan.

is_shown_in_online_booking_engine

Integer

1

it's shown in online_booking_engine for a specific rate plan.

company_id

Integer

Yes

Null

The company_id for a specific rate plan.

parent_rate_plan_id

Integer

Null

The parent_rate_plan_id for specific rate_plan.

policy_code

Character

Null

The policy_code for specific rate_plan.

Response

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

Supported hooks

Filter name: before_get_rate_plans Description: This filter would be executed before retrieving rate_plan details from database in get_rate_plans helper. Usage:

Filter name: should_get_rate_plans Description: This filter would be executed before retrieving rate_plan details from database in get_rate_plans helper. Usage:

hook name: pre.get.rate_plans Description: This hook would be executed before retrieving rate_plan details from database in get_rate_plans helper. Usage:

hook name: post.get.rate_plans Description: This hook would be executed after retrieving rate_plan details from database in get_rate_plans helper. Usage:

Usage

Request Parameters

parameter array filter required for charge details.

Param
Type
Required
Default
Description

rate_plan_name

Character

Yes

Null

The description for a specific charge.

company_id

Integer

Yes

Null

The booking_id for specific charge.

room_type_id

Integer

Yes

Null

The customer_id for a specific charge.

Response

function update_rate_plan($rate_plan, $rate_plan_id) {....}

Usage

Supported hooks

Filter name: before_update_rate_plan Description: This filter would be executed before update rate_plan into the database in update_rate_plan helper. Usage:

Filter name: should_update_rate_plan Description: This filter would be executed before update rate_plan into database in update_rate_plan helper. Usage:

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

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

Request Parameters

Request required rate_plan_id and array format data includes following attributes:

Param
Type
Required
Default
Description

rate_plan_id

Integer

Yes

Null

The primary key of rate plan table for specific rate plan.

rate_plan_name

Character

Yes

Null

The rate_plan_name of specific rate_plan.

room_type_id

Integer

0

The room_type_id for specific rate_plan.

charge_type_id

Integer

0

The charge_type_id for specific rate_plan.

description

Text

Null

The description of specific rate_plan.

number_of_adults_included_for_base_rate

Integer

4

The number of adults included for base_rate in a rate plan.

currency_id

Integer

Null

The currency_id for specific rate_plan.

base_rate_id

Integer

Null

The base_rate_id for specific rate_plan.

is_selectable

Integer

1

The is_selectable for specific rate_plan.

is_shown_in_online_booking_engine

Integer

1

it's shown in online_booking_engine for a specific rate plan.

company_id

Integer

Yes

Null

The company_id for a specific rate plan.

parent_rate_plan_id

Integer

Null

The parent_rate_plan_id for specific rate_plan.

policy_code

Character

Null

The policy_code for specific rate_plan.

Response

function delete_rate_plan($rate_plan_id) {.....}

Usage

Request Parameters

Param
Type
Required
Default
Description

$rate_plan_id

integer

yes

null

The id of the rate plan corresponds to the rate plan table

Response

Last updated