Updating Woocommerce Orders Programmatically

前端 未结 1 1673
[愿得一人]
[愿得一人] 2020-12-20 02:45

I have an eCommerce site running Woocommerce on top of Wordpress, and the company running it has changed there shipping system to an external company who stores the products

相关标签:
1条回答
  • 2020-12-20 03:34

    Found a solution to this yet?

    The code below works to mark an order as complete, but does not execute other actions as you describe in the admin

    // create a new checkout instance and order id
    $checkout = new WC_Checkout();
    $this_order_id = $checkout->create_order();
    
    $order = new WC_Order($this_order_id);
    $order->update_status('completed');
    
    0 讨论(0)
提交回复
热议问题