-
-
Save codee47/6791119 to your computer and use it in GitHub Desktop.
Add script to thank you page in woocommerce.
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 | |
add_action( 'woocommerce_thankyou', 'my_custom_tracking' ); | |
function my_custom_tracking( $order_id ) { | |
// Lets grab the order | |
$order = new WC_Order( $order_id ); | |
/** | |
* Put your tracking code here | |
* You can get the order total etc e.g. $order->get_order_total(); | |
**/ | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment