Heads up! This article contains PHP code and is intended for developers. If you want to add new custom tabs on the WooCommerce products page without any code, I recommend checking out the Custom Product Tab Manager Plugin. The plugin
“woocommerce_new_order” – hook after the order is processed
Are you looking to do something after the order is processed? Then, the “woocommerce_new_order” hook is what you’re looking for. Usage: WooCommerce Customer Journey plugin uses this hook (woocommerce_new_order) to add the customer’s journey map to its database table “_cjforwoo”,
Load Assets Conditionally in your WordPress Plugin
wp_enqueue_scripts hook is the proper hook to enqueue assets (despite the name, both CSS & JS) in the front end. However, if you enqueue assets this way, like all the examples on that documentation – the assets will be loaded
Log PHP data in JavaScript console
There are many built-in methods of logging and troubleshooting in PHP. In most cases, PHP data is logged in an error log file using the error_log() function. The error log is disabled by default in PHP. To enable you’ll need