Created
June 27, 2016 11:26
-
-
Save tankbar/5ede642df0f92a491f3a9f97945e959e to your computer and use it in GitHub Desktop.
Dynamic Purchase Tracking Code - Thank you page
This file contains hidden or 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
// Dynamic Purchase Tracking Code - Thank you page | |
function thankyou_tracking( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
$order_total = $order->get_total(); | |
$order_nr = $order->get_order_number(); | |
?> | |
<!-- Tracking Code --> | |
<?php echo $order_nr; ?> | |
<?php echo $order_total; ?> | |
<!-- END Tracking Tracking Code --> | |
<?php | |
} | |
add_action( 'woocommerce_thankyou', 'thankyou_tracking', 30 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment