Last active
August 31, 2015 09:54
-
-
Save NiklasHogefjord/fc8e9c2c79edc5de272f to your computer and use it in GitHub Desktop.
WooCommerce - Double.net tracking code example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce - Double.net Tracking code | |
* | |
**/ | |
add_action( 'woocommerce_thankyou', 'my_custom_tracking' ); | |
function my_custom_tracking( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
$reference = ltrim( $order->get_order_number(), '#'); | |
$ordervalue = $order->get_total(); | |
echo '<!-- Double tracking code -->'; | |
echo '<img src="https://track.double.net/track/3505/?hash=843bc5&value='.$ordervalue.'&reference='.$reference.'" width="0" height="0" />'; | |
echo '<!-- End Double tracking code -->'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment