function sr_woo_refresh_order($order_id)
 {
     sr_woo_remove_order($order_id);
     //Condn for woo 2.2 compatibility
     if (defined('SR_IS_WOO22') && SR_IS_WOO22 == "true") {
         $order_status = substr(get_post_status($order_id), 3);
     } else {
         $order_status = wp_get_object_terms($order_id, 'shop_order_status', array('fields' => 'slugs'));
         $order_status = !empty($order_status) ? $order_status[0] : '';
     }
     if ($order_status == 'on-hold' || $order_status == 'processing' || $order_status == 'completed') {
         sr_woo_add_order($order_id);
     }
 }
Example #2
0
 function sr_woo_refresh_order($order_id)
 {
     sr_woo_remove_order($order_id);
     $order_status = wp_get_object_terms($order_id, 'shop_order_status', array('fields' => 'slugs'));
     if ($order_status[0] == 'on-hold' || $order_status[0] == 'processing' || $order_status[0] == 'completed') {
         sr_woo_add_order($order_id);
     }
 }