Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created June 22, 2017 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/cfbbc6641b8da7e7005fc9b388f11e87 to your computer and use it in GitHub Desktop.
Save joshfeck/cfbbc6641b8da7e7005fc9b388f11e87 to your computer and use it in GitHub Desktop.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function espresso_track_successful_sharasale($payment_data){
$amount = $payment_data['total_cost'];
$tracking = $payment_data['txn_id'];
$url = 'https://shareasale.com/sale.cfm?';
$url .= 'amount=' . $amount . '&';
$url .= 'tracking=' . $tracking . '&';
$url .= 'transtype=sale&merchantID=73676';
$html = '<img src="' . $url . '" width="1" height="1">';
print($html);
}
add_action('action_hook_espresso_track_successful_sale','espresso_track_successful_sharasale');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment