Advertisement
Guest User

hook for wp affiliate with marketpress

a guest
Dec 19th, 2015
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2.  
  3. function custom_mp_cart_payment( $content, $type ){
  4.  
  5.     if ($type == 'confirmation'){
  6.         $content .= 'Your code here.';
  7.         $sale_amt = "199"; //TODO - The commission is calculated based on this amount
  8. $unique_transaction_id = "Txn-ID"; //TODO - The unique transaction ID for reference
  9. $email = "Buyer-email-goes-here"; //TODO - Customer email for record
  10. $referrer = $_COOKIE['ap_id'];//Cookie value is read from the customer's browser
  11. do_action('wp_affiliate_process_cart_commission', array("referrer" => $referrer, "sale_amt" =>$sale_amt, "txn_id"=>$unique_transaction_id, "buyer_email"=>$email));
  12.     }
  13.  
  14. return $content;
  15. }
  16. add_filter('_mp_cart_payment', 'custom_mp_cart_payment', 10, 2 );
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement