Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function custom_mp_cart_payment( $content, $type ){
- if ($type == 'confirmation'){
- $content .= 'Your code here.';
- $sale_amt = "199"; //TODO - The commission is calculated based on this amount
- $unique_transaction_id = "Txn-ID"; //TODO - The unique transaction ID for reference
- $email = "Buyer-email-goes-here"; //TODO - Customer email for record
- $referrer = $_COOKIE['ap_id'];//Cookie value is read from the customer's browser
- do_action('wp_affiliate_process_cart_commission', array("referrer" => $referrer, "sale_amt" =>$sale_amt, "txn_id"=>$unique_transaction_id, "buyer_email"=>$email));
- }
- return $content;
- }
- add_filter('_mp_cart_payment', 'custom_mp_cart_payment', 10, 2 );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement