• Hi There!

    I want to create a code snippet that completes an order based on a specific order note (“Budbee order status: Delivered”). I have some code but it doesn’t work. Can anyone please help me? PHP is not my “native” language, so I am not sure if and where I made mistakes.

    
    add_action( 'woocommerce_new_customer_note', 'auto_complete_budbee_delivered' );
    
    function auto_complete_budbee_delivered( $order_id, $customer_note ) {
        if ($customer_note == "Budbee order status: Delivered") {
            $order = wc_get_order( $order_id );
            $order->update_status( 'completed' );
        }
    }
    

    Thank you!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hi @cpvandermade,

    Unfortunately, I don’t think I have enough experience with WooCommerce to answer this. You might have more luck asking in a WooCommerce-specific forum.

Viewing 1 replies (of 1 total)
  • The topic ‘woocommerce_new_customer_note help to complete order’ is closed to new replies.