Hallo,
ich möchte Bestellungen als *.csv ausgeben (Tabeller Orders), wenn möglich durch die Vorgabe bestimmter Bestellnummern z.B. 50-100,
Leider bekomme ich keines der gefundenen Scripte zum funktionieren!
xt:Commerce v3.0.4 SP2.1
wer hat mir eine Lösung, Hilfe, Anleitung?
oder ein Beispieltool wie im xt-forum genannt wird:
Wie so ein Daten-Export-Programm aussehen kann findest Du auch unter:http://www.xt-commerce.com/forum/s-a...portieren.html Es schließlich vollkommen egal, ob Du Kunden oder Bestellungen exportierst.
gefundenes Beispiel Script
<?php
include( 'includes/application_top.php');
header('Content-Type: text/x-csv');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Disposition: attachment; filename=orders.csv');
header('Pragma: no-cache');
$ResultPointer = xtc_db_query("SELECT
orders_id,
customers_id,
customers_cid,
customers_name,
customers_company,
customers_street_address,
customers_suburb,
customers_city,
customers_postcode,
customers_country,
customers_telephone,
customers_email_address,
delivery_name,
delivery_company,
delivery_street_address,
delivery_suburb,
delivery_city,
delivery_postcode,
delivery_country,
billing_name,
billing_company,
billing_street_address,
billing_suburb,
billing_city,
billing_postcode,
billing_country,
payment_method,
comments,
date_purchased,
orders_status
FROM " . TABLE_ORDERS . " WHERE
orders_id = '" . $_GET['oID'] . "'");
for($i=0, $Export=""; $i<xtc_db_num_rows($ResultPointer); $i++)
{
$Daten = xtc_db_fetch_array($ResultPointer);
$Spalte[] = str_replace("\"", "\"\"", $Daten['orders_id']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['customers_cid']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['customers_id']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['customers_name']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['customers_company']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['customers_street_address']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['customers_suburb']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['customers_city']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['customers_postcode']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['customers_country']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['customers_telephone']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['customers_email_address']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['delivery_name']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['delivery_company']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['delivery_street_address']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['delivery_suburb']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['delivery_city']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['delivery_postcode']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['delivery_country']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['billing_name']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['billing_company']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['billing_street_address']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['billing_suburb']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['billing_city']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['billing_postcode']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['billing_country']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['payment_method']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['payment_method']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['date_purchased']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['payment_method']);
$Spalte[] = str_replace("\"", "\"\"", $Daten['orders_status']);
for($j=0; $j<count($Spalte); $j++)
{
$Export .= "\"" . $Spalte[$j] . "\"";
if($j!=count($Spalte)-1)
$Export .= ";";
}
$Export .= "\r\n";
$Spalte = "";
}
echo$Export;
?>
Beste Grüsse und Dank
JO