Auto set Woocommerce product to draft status if order is completed
问题 In WooCommerce I would like to set products to draft status when Order is completed… So what I want is to make products to be sold 1 time and passed to draft when order get completed. Any idea? 回答1: Try the following code, that will set the products found in order items with a "draft" status only when order get "processing" or "completed" statuses (paid order statuses) : add_action( 'woocommerce_order_status_changed', 'action_order_status_changed', 10, 4 ); function action_order_status