0

1) Which page do I add the referral tracking code in and where?

Hey this sound silly but how do I find the thank you page when I used WooCommerce? I search in the CPanel and got confused which file do I need to add the code.

Stated in the Referral Candy's page, that I need to find the page that customers go to right after they complete payment for their purchase, where exactly it is in WooCommerce WordPress?

2) One more, where do I go to make sure that my store provides with dynamic checkout variables?

Thanks.

nani.nsr
  • 23
  • 5
  • There is an official plugin that make that integration: [ReferralCandy for WooCommerce](https://wordpress.org/plugins/referralcandy-for-woocommerce/) *(by ReferralCandy)* – LoicTheAztec Mar 28 '18 at 03:29

1 Answers1

0

This is one possible solution, place this code in your functions.php file, it will add the candy tracking code to your thank you page. You also have access to the order id with this hook if you need to track that with your referral code. Place your referral tracking code where I have written it below.

add_action( 'woocommerce_thankyou', 'add_candy_referral_script');

function add_candy_referral_script( $order_id ) {
    ?>
    // Your referral tracking code here
    <?php
}
Andrew Schultz
  • 4,092
  • 2
  • 21
  • 44
  • Thanks for your response, however I tried that code in function.php but there's no popup appear. So basically, it doesn't work on my site :( – nani.nsr Mar 28 '18 at 09:12
  • @nani.nsr try the plugin as suggested. If that doesn't work let me know. – Andrew Schultz Mar 28 '18 at 10:42
  • Of course i did! I just want to adjust the name "John Smith" in the popup. So that when user enter their name and email, the popup will write up their name instead (not John Smith). I got confuse where to edit the dynamic checkout variables. As I check the file for the "John Smith" name in my CPanel file and edited it, still no result. But worst, popup didn't appear. – nani.nsr Mar 30 '18 at 03:20
  • @nani.nsr if the plugin doesn't work then raise a support issue with the plugin developer. – Andrew Schultz Mar 30 '18 at 03:47