Shopping Cart
The following hooks are provided for Shopping Cart related events.
AcceptOrder
Runs when an order is accepted prior to any acceptance actions being executed
Parameters
Variable | Type | Notes |
---|---|---|
order_id | int | |
user_id | int | |
client | Array/Object | User information |
items | Array/Object | items list |
Response
No response supported
Example Code
<?php
add_hook('AcceptOrder', 1, function($vars)
{
});
AfterShoppingCartCheckout
Upon completion of checkout once the order has been created, invoice generated and all email notifications sent
Parameters
Variable | Type | Notes |
---|---|---|
order_id | int | |
invoice_id | int |
Response
No response supported
Example Code
<?php
add_hook('AfterShoppingCartCheckout', 1, function($vars)
{
});
CancelOrder
Runs when an order is requested to be cancelled, prior to the change of status actually occurring.
Parameters
Variable | Type | Notes |
---|---|---|
order_id | int | |
order | Array/Object | Order Information |
items | Array/Object | Order Information |
user_id | int | Client ID |
Response
No response supported
Example Code
<?php
add_hook('CancelOrder', 1, function($vars)
{
});
CartSubdomainValidation
Executes when Cart Subdomain Validation is occurring
Parameters
Variable | Type | Notes |
---|---|---|
domain | string | Domain Name |
Response
Return any validation errors. eg: return ["abort"=>true,"message"=>"Your Error Message Here"];
Example Code
<?php
add_hook('CartSubdomainValidation', 1, function($vars)
{
return ["abort"=>true,"message"=>"Your Error Message Here"];
});
DeleteOrder
Runs when an order is requested to be deleted, prior to the deletion actually occurring.
Parameters
Variable | Type | Notes |
---|---|---|
order_id | int | |
order | Array/Object | Order Information |
items | Array/Object | Order Information |
user_id | int | Client ID |
Response
No response supported
Example Code
<?php
add_hook('DeleteOrder', 1, function($vars)
{
});
FraudOrder
Runs when an order is requested to be set as fraud, prior to the change of status actually occurring.
Parameters
Variable | Type | Notes |
---|---|---|
order_id | int | |
order | Array/Object | Order Information |
items | Array/Object | Order Information |
user_id | int | Client ID |
Response
No response supported
Example Code
<?php
add_hook('FraudOrder', 1, function($vars)
{
});
OrderPaid
Executes when the first invoice for a new order is marked paid. This will execute in addition to the regular invoice payment hooks.
Parameters
Variable | Type | Notes |
---|---|---|
order_id | int | |
invoice_id | int | |
order | Array/Object | Order Information |
items | Array/Object | Order Information |
user_id | int | Client ID |
Response
No response supported
Example Code
<?php
add_hook('OrderPaid', 1, function($vars)
{
});
PendingOrder
Runs when an order is requested to be set back to pending, prior to the change of status actually occurring.
Parameters
Variable | Type | Notes |
---|---|---|
order_id | int | |
order | Array/Object | Order Information |
items | Array/Object | Order Information |
user_id | int | Client ID |
Response
No response supported
Example Code
<?php
add_hook('PendingOrder', 1, function($vars)
{
});
OrderProductUpgradeOverride
Executes as a product upgrade order is being calculated.
Parameters
Variable | Type | Notes |
---|---|---|
old_item_id | int | |
old_item_name | string | |
new_item_id | int | |
new_item_name | string | |
days | int | Remaining Days |
total_days | int | Total Days |
new_item_billing_cycle | string | Billing Cycle |
price | float | Amount |
discount | float | Discount Amount |
promo_qualifies | bool | true/false |
Response
Return any key -> value pairs of the parameters to override. eg return ['discount'=>10.00];
Example Code
<?php
add_hook('OrderProductUpgradeOverride', 1, function($vars)
{
$array = [];
$array["discount"]=10.00; // Total Discount in Value
$array["price"]=20.00; // New Serice/Product Price
$array["total_days"]=365; // Total Days of Service/Product
$array["days"]=180; // Remaining Days of Service/Product
return $array;
});
OverrideOrderNumberGeneration
Executes prior to checkout. All cart information is passed to the hook.
Parameters
Variable | Type | Notes |
---|---|---|
No Input Parameters available |
Response
Return the custom order number to be used (must be a valid numeric value) eg return ['number'=>123456789];
Example Code
<?php
add_hook('OrderProductUpgradeOverride', 1, function($vars)
{
return ['number'=>123456789];
});
ShoppingCartValidateDomainsConfig
Executes when Domain Configuration Update is occurring.
Parameters
Variable | Type | Notes |
---|---|---|
id | int | Cart Unique ID |
name_server_one | string | |
name_server_two | string | |
name_server_three | string | |
name_server_four | string | |
AdditionalFields | Array | Additional fields information |
Response
Return any key -> value pairs of the parameters to return errors. eg return ['abort'=>true,'message'=>'Your Error Message Here'];
Example Code
<?php
add_hook('ShoppingCartValidateDomainsConfig', 1, function($vars)
{
return ['abort'=>true,'message'=>'Your Error Message Here'];
});
ShoppingCartValidateProductConfig
Executes when Domain Configuration Update is occurring.
Parameters
Variable | Type | Notes |
---|---|---|
id | int | Cart Unique ID |
clientid | int | |
group | int | |
config | Array | |
ip | string |
Response
Return any key -> value pairs of the parameters to return errors. eg return ['abort'=>true,'message'=>'Your Error Message Here'];
Example Code
<?php
add_hook('ShoppingCartValidateProductConfig', 1, function($vars)
{
return ['abort'=>true,'message'=>'Your Error Message Here'];
});