Ecommerce Shopify WordPress Discussion

wordpress woocommerce action hook working on woocommerce android app but action hook not working on woocommerce admin wp-admin login

I am currently working on a WordPress/WooCommerce project where I have implemented a custom function to be triggered when an order's status changes to "completed." The code is set up as follows: add_action('woocommerce_order_status_completed', 'custom_function_after_order_completed', 10, 1); function custom_function_after_order_completed($order_id) { // Custom script execution logic here // ... } This setup works perfectly on the frontend, and the custom script is executed as expected when an order is marked as "completed." However, I've noticed that the hook does not work when the order status change is triggered within the WooCommerce admin dashboard. I have checked the following: The hook is registered correctly, and the callback function is defined. PHP error logging is enabled, and there are no errors logged in the error log. The order status is set to "completed" when testing. The exec command is not the issue, as the script runs successfully on the WooCommerce app for Android. It appears that the WooCommerce admin dashboard processes the order status change differently, and the hook is not triggered as expected. Questions: Is there a specific hook or method that should be used for order status changes initiated from the WooCommerce admin dashboard? Are there any known differences in how order status changes are processed on the admin page compared to the frontend? Are there any additional debugging steps I can take to identify why the hook is not working specifically on the WooCommerce admin page? I appreciate any insights or guidance on resolving this issue. I am trying to run a script after order status changes to 'complete' to trigger the script to my delivery backend. i have tried to hook using the ''completed email'' as trigger (only works on android app not admin) Also through post update add_action('transition_post_status', 'custom_function_after_post_status_transition', 10, 3); function custom_function_after_post_status_transition($new_status, $old_status, $post) { // Check if the post is a WooCommerce order if ($post->post_type === 'shop_order') { // Check if the transition is from 'pending' to 'completed' if ($old_status === 'wc-pending' && $new_status === 'wc-completed') { // Get the order ID $order_id = $post->ID;
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.