If you receive an error message on line 153 of stats_recover_cart_sales.php regarding an invalid argument supplied for the foreach() function, then before line 119:

PHP Code:
if (!$orders->EOF) {
  
$custknt++;
  
$total_recovered += $orders->fields['value'];
  
$cust_array[$custknt] = array_merge($scart->fields$orders->fields);

add:

PHP Code:
$cust_array = array();