• Resolved Saurabh Jain

    (@saurabhj91)


    Hi Team,

    Is there any hook which is triggered when the vendor mark the order as shipped? I want to change the order status when the order is marked as shipped.

Viewing 7 replies - 1 through 7 (of 7 total)
  • @saurabhj91 You can use this hook ‘wcmp_vendors_vendor_ship’ to change the status of the order-
    do_action(‘wcmp_vendors_vendor_ship’, $order_id, $vendor->term_id);

    Let us know if you have any further query.

    Thread Starter Saurabh Jain

    (@saurabhj91)

    Hi Team,

    Thanks for the response. I’ll check and let you know.

    Thread Starter Saurabh Jain

    (@saurabhj91)

    Hi Team,

    I guess there is some confusion, I have created a new WooCommerce order status “Handover”. I want to change the order status from processing to handover when the order is marked as shipped by the vendor.

    Kindly use your custom coding in this hook’s callback function “wcmp_vendors_vendor_ship”, it will display the order status you have set when the vendor will mark the order as shipped.

    Now, in order to change the order status, please follow this document – https://docs.woocommerce.com/wc-apidocs/class-WC_Order.html

    Thread Starter Saurabh Jain

    (@saurabhj91)

    Ok, Got it.

    Thanks anyways. I’ll check and update here.

    Sure Saurabh. Keep us posted.

    Thread Starter Saurabh Jain

    (@saurabhj91)

    @dualcube I was able to do from below code.

    add_action('wcmp_vendors_vendor_ship','handover_order_func');
    function handover_order_func( $order_id, $vendor_term_id){
        $order = new WC_Order($order_id);
        if($order->get_status() != 'order-handed'){
            $order->update_status('order-handed', 'order_note');
        }
    }
    • This reply was modified 7 years, 1 month ago by Saurabh Jain.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Change order status when vendor mark order as shipped.’ is closed to new replies.