Products and Services
The following hooks are provided for Products and Services related events.
AfterProductUpgrade
Parameters
| Variable | Type | Notes |
|---|---|---|
| item_id | int | Service/Product ID which is upgraded to New Package/Plan |
| package_id | int | New Package/Plan ID |
Response
No response supported
Example Code
<?php
add_hook('AfterProductUpgrade', 1, function($vars) {
// Perform hook code here...
});
ProductDelete
Executes a product is being deleted.
Parameters
| Variable | Type | Notes |
|---|---|---|
| item_id | int |
Response
No response supported
Example Code
<?php
add_hook('ProductDelete', 1, function($vars) {
// Perform hook code here...
});
ProductEdit
Executes as a Product is being edited.
Parameters
| Variable | Type | Notes |
|---|---|---|
| item_id | int | The id of the product being saved. |
| tid | int | Service/Product ID |
| account_type | string | Service/Product Type Name |
| gid | int | The group id the product belongs to |
| title | string | Name of Service/Product |
| description | string | Description of Service/Product |
| eid_welcome | int | The id of the welcome email |
| domain_registration_option | string | YES/NO |
| server_config_option_show | string | YES/NO |
| is_stock_control | string | YES/NO |
| unit_in_stock | int | Qty in Stock |
| apply_tax | string | YES/NO |
| highlight_text | string | if Text exist then Service Featured |
| is_hidden | string | YES/NO |
| payment_time | string | free, onetime or recurring |
| price_duration | string | Means Recurring time period |
| auto_terminate_days | int | |
| auto_terminate_email | int | |
| prorata_billing_enable | string | YES/NO |
| prorata_billing_day | int | |
| charge_next_month | int | Prorata Charge Next Month |
| server_type | string | Server/Module Name which is selected |
| server_group_id | int | Server Group ID |
| server_package_name | string | Server Package Name which is selected/Entered |
| product_setup_after | string | Product Auto Setup Options ORDER_PLACED = Automatically setup the product as soon as an order is placed PAYMENT_RECEIPT = Automatically setup the product as soon as the first payment is received ORDER_ACCEPTTED = Automatically setup the product when you manually accept a pending order MANUALLY = Do not automatically setup this product |
| product_upgrade_plans_enable | string | YES/NO |
| product_upgrade_email | int | |
| free_domain | string | |
| free_domain_period | string | |
| free_domain_tlds | string | |
| is_affiliate_payout_type | string | One Time/Recurring |
| affiliate_pay_amount | float | |
| custom_affiliate_payout | string | Use Default, Percentage, Fixed Amount, No Commission |
| subdomain_options | string | |
| is_overages_billing | string | YES/NO |
| disk_usage_limits | int | |
| bandwidth_usage_limits | int | |
| disk_usage_limits_cost | float | |
| bandwidth_usage_limits_cost | float | |
| product_upgrade_plans | Array/Object | |
| recurring_cycles_limit | int | |
| notes | string | |
| module_configurations | json |
Response
No response supported
Example Code
<?php
add_hook('ProductEdit', 1, function($vars) {
// Perform hook code here...
});
ServerAdd
Executes as a server is created
Parameters
| Variable | Type | Notes |
|---|---|---|
| server_id | int |
Response
No response supported
Example Code
<?php
add_hook('ServerAdd', 1, function($vars) {
// Perform hook code here...
});
ServerDelete
Executes as a server is being deleted.
Parameters
| Variable | Type | Notes |
|---|---|---|
| server_id | int |
Response
No response supported
Example Code
<?php
add_hook('ServerDelete', 1, function($vars) {
// Perform hook code here...
});
ServerEdit
Executes as a server is being edited.
Parameters
| Variable | Type | Notes |
|---|---|---|
| server_id | int |
Response
No response supported
Example Code
<?php
add_hook('ServerEdit', 1, function($vars) {
// Perform hook code here...
});