• Resolved SZ4H

    (@sz4h)


    Hello,

    In native woocommerce statuses there is an action

    do_action('woocommerce_order_status_completed');

    I’m trying to hook into a custom order status created by your plugin to do some task if the order changed to that status

    example
    add_action('woocommerce_order_status_' . $status, [$this,'woocommerce_order_status_other'], 10, 1);

    The action never hits
    I’ve checked your plugin code for do_action events but find nothing

    Can you please provide me with any help. Regarding this?

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author tychesoftwares

    (@tychesoftwares)

    Hi @sz4h,

    Oh, you’re missing for adding slug for order status. You must have to add the slug of order status after “woocommerce_order_status_” hook.

    For example,

    add_action('woocommerce_order_status_shipping-how-to', [$this,'woocommerce_order_status_other'], 10, 1);
    //where 'shipping-how-to' is the slug of order status.
    

    Try this solution and do let me know how it works.

Viewing 1 replies (of 1 total)
  • The topic ‘Action on change order status’ is closed to new replies.