wordpress - Status of the Woocommerce order change from processing to complete after the order is placed with COD? -


i have online store customers place order , done payment cod. integrated our warehouse management export orders @ end of day system site. status of orders places processing. trying make php cron job order status of these order set completed when list of orders exported.

i have looked @ various solutions , change order status @ time of placing order while want later, once data exported.

if can me php function sets order in woocommerce "complete" @ trigger, grateful.

in cron function may have loop order id needs exported, pass order id given function it'll update order status wc-complete, can pass order note if need.

function wh_mark_order_as_omplete($order_id, $note = '') {     //this check option if not need can remove it.     //for cod order     if ('cod' != get_post_meta($order_id, '_payment_method', true))         return;      $order = wc_get_order($order_id);      if (empty($note)):         $order->update_status('completed');     else:         $order->update_status('completed', $note);     endif; } 

hope helps!


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -