Skip to content

Instantly share code, notes, and snippets.

@colinhoward
Created March 9, 2015 23:07
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 colinhoward/022f8c787b264030d9f8 to your computer and use it in GitHub Desktop.
Save colinhoward/022f8c787b264030d9f8 to your computer and use it in GitHub Desktop.
WooCommerce <> HasOffers integration
<?php }
add_action( 'woocommerce_thankyou', 'my_custom_tracking' );
function my_custom_tracking( $order_id ) {
$order = new WC_Order( $order_id );
$total = $order->get_order_total();
$id = str_replace('#', '', $order->get_order_number());
echo '<iframe src="https://NETWORKID.go2cloud.org/aff_l?offer_id=OFFERID&amount=' . $total . '&adv_sub=' . $id . '" scrolling="no" frameborder="0" width="1" height="1"></iframe>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment