Cashback events
Cashback Tracker - is plugin for tracking and statistic. Maybe you want to extend it's functions. For this, we added several hooks
You must have code skills for PHP and WordPress to understand this part of documentation.

Order hooks

Cashback Tracker has three events which you can use for custom functions
cbtrkr_order_create
new order was added with pending status
cbtrkr_order_approve
order got approved status
cbtrkr_order_decline
order got declined status
Example of hook:
1
add_action('cbtrkr_order_create', 'myOrderCreate');
2
3
function myOrderCreate($order)
4
{
5
//print_r($order);
6
}
Copied!
Variable will have array with next data:
1
array
2
(
3
'id' => '177'
4
'user_id' => '1'
5
'order_id' => '1556116749647'
6
'module_id' => 'Demo'
7
'create_date' => '2019-04-24 14:39:09'
8
'order_status' => '0'
9
'completion_date' => null
10
'advertiser_id' => '123'
11
'advertiser_domain' => 'example.com'
12
'currency_code' => 'USD'
13
'sale_amount' => '590.00'
14
'commission_amount' => '29.50'
15
'subid' => 'cbtrkr-1'
16
'click_date' => '2019-04-04 04:59:14'
17
'action_date' => '2019-04-20 07:55:01'
18
'user_referer' => ''
19
'api_response' => ''
20
'merchant_order_id' => '1556116749647'
21
)
Copied!
Example of code to calculate cashback and currency:
1
list($amount, $currency) = \CashbackTracker\application\components\Commission::calculateCashback($order);
Copied!
Last modified 1yr ago
Copy link
Contents
Order hooks