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

VariableTypeNotes
order_idint
user_idint
clientArray/ObjectUser information
itemsArray/Objectitems 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

VariableTypeNotes
order_idint
invoice_idint

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

VariableTypeNotes
order_idint
orderArray/ObjectOrder Information
itemsArray/ObjectOrder Information
user_idintClient ID

Response

No response supported

Example Code

<?php
add_hook('CancelOrder', 1, function($vars)
{
});

CartSubdomainValidation

Executes when Cart Subdomain Validation is occurring

Parameters

VariableTypeNotes
domainstringDomain 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

VariableTypeNotes
order_idint
orderArray/ObjectOrder Information
itemsArray/ObjectOrder Information
user_idintClient 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

VariableTypeNotes
order_idint
orderArray/ObjectOrder Information
itemsArray/ObjectOrder Information
user_idintClient 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

VariableTypeNotes
order_idint
invoice_idint
orderArray/ObjectOrder Information
itemsArray/ObjectOrder Information
user_idintClient 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

VariableTypeNotes
order_idint
orderArray/ObjectOrder Information
itemsArray/ObjectOrder Information
user_idintClient 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

VariableTypeNotes
old_item_idint
old_item_namestring
new_item_idint
new_item_namestring
daysintRemaining Days
total_daysintTotal Days
new_item_billing_cyclestringBilling Cycle
pricefloatAmount
discountfloatDiscount Amount
promo_qualifiesbooltrue/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

VariableTypeNotes
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

VariableTypeNotes
idintCart Unique ID
name_server_onestring
name_server_twostring
name_server_threestring
name_server_fourstring
AdditionalFieldsArrayAdditional 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

VariableTypeNotes
idintCart Unique ID
clientidint
groupint
configArray
ipstring

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'];
});