Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

saving each order into a different csv file on server


pmaonline

Recommended Posts

Posted

Hi i'm trying to : each time a costumer makes an order, it is saved to a csv file to server,i inserted this code in checkout sucess :

 

$day=date('d');

$month=date('m');

$year=date('Y');

$hour=date('h');

$minute=date('i');

$second=date('s');

$filename ="c_" . $year.''. $month.''. $day.'_'. $hour.'_'. $minute.'_'. $second .".csv";

 

$myFile= fopen($filename,'a');

 

if(! $myFile){

 

print ("File could not be opened.");

exit;

}

 

 

 

$csv_output.="teste".";";

$csv_output.="\n";

 

 

 

 

fputs($myFile, $csv_output); // Write the data ($string) to the text file

 

 

 

 

 

 

 

 

 

 

but i don't know witch variables should i insert.

 

Thanks for help

Posted
Hi i'm trying to : each time a costumer makes an order, it is saved to a csv file to server,i inserted this code in checkout sucess :

 

$day=date('d');

$month=date('m');

$year=date('Y');

$hour=date('h');

$minute=date('i');

$second=date('s');

$filename ="c_" . $year.''. $month.''. $day.'_'. $hour.'_'. $minute.'_'. $second .".csv";

 

$myFile= fopen($filename,'a');

 

if(! $myFile){

 

print ("File could not be opened.");

exit;

}

 

$csv_output.="teste".";";

$csv_output.="\n";

 

fputs($myFile, $csv_output); // Write the data ($string) to the text file

but i don't know witch variables should i insert.

 

Thanks for help

 

$email_order in checkout_process.php seems to have all the order and customer data already gathered up for you. I use it for a custom order printing routine. I dunno if checkout_process.php is called too early in the process for you. If so, you could at least look at how the $email_order variable is built there and perhaps replicate that process in checkout_success.php.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...