public static function update_items_order($cat_id = 0, $item_orders = array())
 {
     if (is_array($item_orders) && count($item_orders) > 0) {
         foreach ($item_orders as $field_id => $field_order) {
             WC_Compare_Categories_Fields_Data::update_order($cat_id, $field_id, $field_order);
         }
     }
 }
 public static function woocp_update_orders()
 {
     check_ajax_referer('woocp-update-order', 'security');
     $updateRecordsArray = $_REQUEST['recordsArray'];
     $cat_id = $_REQUEST['cat_id'];
     $listingCounter = 1;
     foreach ($updateRecordsArray as $recordIDValue) {
         WC_Compare_Categories_Fields_Data::update_order($cat_id, $recordIDValue, $listingCounter);
         $listingCounter++;
     }
     _e('You just save the order for Compare Features.', 'woo_cp');
     die;
 }