WooCommerce is an eCommerce shopping cart solution for WordPress websites that was developed in 2011. It is designed for small to large online companies. WooCommerce quickly gained popularity due to its ease of use and flexibility. The best part is that it is an open-source product. Because it's a self-hosted solution, it doesn't levy transaction fees or control bandwidth or storage. Hundreds of extensions are available to meet your needs. WooCommerce powers 41 percent of all eCommerce sites, with over 30,954,070 downloads, so you're in good company.
Step 1. From your admin dashboard, click on "Set Up Software".
Step 2. Under Set up Software, go to "Link Software to My Store".
Step 3. From the drop-down menu, select "Woocommerce" and then "copy" the code.
Step 4. Check this file /wp-content/plugins/woocommerce/templates/checkout/thankyou.php at your installed WordPress and paste copied code after this line (it would be near line # 80).
<?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?>