Jump to content

dvharrison

Members
  • Content count

    370
  • Joined

  • Last visited

Everything posted by dvharrison

  1. Hi all I am using http://addons.oscommerce.com/info/4728 to export our order data into CSV format, however in order for it to work fully, a unique item ID is necessary for orders with more than one product. My question is, is an order item ID available in the database as standard? If not, is there an add-on which can accomplish this? I have had a search but as yet I cannot find anything. Furthermore, would it be simple to add a unique order item ID to the CSV output? I have a basic knowledge of PHP, and am a very quick learner. I look forward to receiving any help. Please please don't ignore me. Many thanks in advance
  2. dvharrison

    Does each order line have a unique ID number

    Hi Jim It didn't work. What did work though was to call a \r (return) instead of the \n (line break). Thank you for your help though. It is always good to have assistance! ;)
  3. Actually no. Please help multi zones that I listed above only actually works if you don't need to export the order data into a CSV to Sage. I am looking at http://addons.oscommerce.com/info/4150 and wondered if this add-on would work alongside this one, (using counties to determine delivery instead of countries. Please please help.
  4. dvharrison

    Does each order line have a unique ID number

    I shall show the top part of the CSV output section as so far nothing I've tried seems to work. Brace yourself this is long :blink: <?php } // submitted so generate csv if the form is submitted else { generatecsv($start, $end, $status, $submitted); } // generates csv file from $start order to $end order, inclusive function generatecsv($start, $end, $status, $submitted) { $order_edit = "&action=edit"; $order_url = "http://www.blueplasters.com/pad/orders.php?oID=$order_num"; $space = " "; $open_table = $submitted == 1 ? '' : '<table width=100% border=1 cellspacing=0 cellpadding=0>'; $close_table = $submitted == 1 ? '' : '</table>'; $open_header = $submitted == 1 ? '' : '<tr bgcolor=#cccccc>'; $close_header = $submitted == 1 ? '' : '</tr>'; $open_row = $submitted == 1 ? '' : '<tr>'; $close_row = $submitted == 1 ? '' : '</tr>'; $open_column = $submitted == 1 ? '' : '<td><font face=verdana size=2>'; $delim = $submitted == 1 ? ',' : '</font></td>'; if($submitted == 1){ // Heading CSV output file $csv_output .= "Order ID".$delim; $csv_output .= "Date".$delim; $csv_output .= "Bill Name".$delim; /* $csv_output .= "Last".$delim; */ $csv_output .= "Address1".$delim; $csv_output .= "Address2".$delim; $csv_output .= "City".$delim; $csv_output .= "State".$delim; $csv_output .= "Zip".$delim; $csv_output .= "Phone".$delim; $csv_output .= "Ship Name".$delim; $csv_output .= "Address1".$delim; $csv_output .= "Address2".$delim; $csv_output .= "City".$delim; $csv_output .= "State".$delim; $csv_output .= "Zip".$delim; $csv_output .= "Shipping Method".$delim; $csv_output .= "Shipping Cost".$delim; $csv_output .= "Trans ID".$delim; $csv_output .= "Model".$delim; $csv_output .= "Qty".$delim; $csv_output .= "Price".$delim; $csv_output .= "Product".$delim; $csv_output .= "\n"; } $orders = tep_db_query("select customers_id, orders_id, date_purchased, customers_name , cc_owner, customers_company, customers_email_address, billing_street_address, billing_city, billing_state, billing_postcode, billing_country, customers_telephone, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_state, delivery_postcode, delivery_country, cc_type, cc_number, cc_expires, payment_method, orders_status from " . TABLE_ORDERS . " where 1 " . ($start ? "and orders_id >= $start " : "") . ($end ? "and orders_id <= $end " : "") . ($status ? "and orders_status = $status " : "") . "order by customers_id"); while ($row_orders = mysql_fetch_array($orders)) { //start one loop $Orders_id = $row_orders["orders_id"]; $orders_status = $row_orders["orders_status"]; $customers_id = $row_orders["customers_id"]; $customers_gender = $row_orders["customers_gender"]; $Date1 = $row_orders["date_purchased"]; //list($Date, $Time) = explode (' ',$Date1); $Date = date('d/m/Y', strtotime($Date1)); $Time= date('H:i:s', strtotime($Date1)); $Name_On_Card1 = $row_orders["customers_name"]; $Name_On_Card = filter_text($Name_On_Card1);// order changed list($First_Name,$Last_Name) = explode(', ',$Name_On_Card1); // order changed $Company = filter_text($row_orders["customers_company"]); $email = filter_text($row_orders["customers_email_address"]); $payment = filter_text($row_orders["payment_method"]); $Billing_Address_1 = filter_text($row_orders["billing_street_address"]); $Billing_Address_2 = ""; $Billing_City = filter_text($row_orders["billing_city"]); $Billing_State = filter_text($row_orders["billing_state"]); $Billing_Zip = filter_text($row_orders["billing_postcode"]); $Billing_Country = str_replace("(48 Contiguous Sta", "", $row_orders["billing_country"]); $Billing_Phone = filter_text($row_orders["customers_telephone"]); $ShipTo_Name1 = $row_orders["delivery_name"]; $ShipTo_Name = filter_text($ShipTo_Name1); // order changed list($ShipTo_First_Name,$ShipTo_Last_Name) = explode(', ',$ShipTo_Name1); // order changed $ShipTo_Company = filter_text($row_orders["delivery_company"]); $ShipTo_Address_1 = filter_text($row_orders["delivery_street_address"]); $ShipTo_Address_2 = ""; $ShipTo_City = filter_text($row_orders["delivery_city"]); $ShipTo_State = filter_text($row_orders["delivery_state"]); $ShipTo_Zip = filter_text($row_orders["delivery_postcode"]); $ShipTo_Country = str_replace("(48 Contiguous Sta", "", $row_orders["delivery_country"]); $ShipTo_Phone = ""; $Card_Type = $row_orders["cc_type"]; $Card_Number = $row_orders["cc_number"]; $Exp_Date = $row_orders["cc_expires"]; $Bank_Name = ""; $Gateway = ""; $AVS_Code = ""; $Transaction_ID = ""; $Order_Special_Notes = ""; // -------------------- QUERIES 1 ------------------------------------// //Orders_status_history for comments $orders_status_history = tep_db_query("select comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = " . $Orders_id); //$row_orders_status_history = tep_db_fetch_array($comments); while($row_orders_status_history = mysql_fetch_array($orders_status_history)) { // end // $Comments = filter_text($row_orders_status_history["comments"]); } // -------------------- QUERIES 2 ------------------------------------// //Orders_subtotal $orders_subtotal = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where class = 'ot_subtotal' and orders_id = " . $Orders_id); //$row_orders_subtotal = tep_db_fetch_array($orders_subtotal); while($row_orders_subtotal = mysql_fetch_array($orders_subtotal)) { // end // $Order_Subtotal = filter_text($row_orders_subtotal["value"]); } // -------------------- QUERIES 3 ------------------------------------// //Orders_tax $Order_Tax = '0'; $orders_tax = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where class = 'ot_tax' and orders_id = " . $Orders_id); //$row_orders_tax = tep_db_fetch_array($orders_tax); while($row_orders_tax = mysql_fetch_array($orders_tax)) { // end // $Order_Tax = filter_text($row_orders_tax["value"]); } // -------------------- QUERIES 4 ------------------------------------// //Orders_Insurance $orders_insurance = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where class = 'ot_insurance' and orders_id = " . $Orders_id); //$row_orders_insurance = tep_db_fetch_array($orders_insurance); while($row_orders_insurance = mysql_fetch_array($orders_insurance)) { // end // $Order_Insurance = filter_text($row_orders_insurance["value"]); } $Tax_Exempt_Message = ""; // -------------------- QUERIES 5a ------------------------------------// //Orders_Shipping Versandkosten $orders_shipping = tep_db_query("select title, value from " . TABLE_ORDERS_TOTAL . " where class = 'ot_shipping' and orders_id = " . $Orders_id); //$row_orders_shipping = tep_db_fetch_array($orders_shipping); while($row_orders_shipping = mysql_fetch_array($orders_shipping)) { // end // $Order_Shipping_Total = $row_orders_shipping["value"]; $Shipping_Method = filter_text($row_orders_shipping["title"]); // Shipping method from query 5 } // -------------------- QUERIES 5b ------------------------------------// //Orders_Shipping_Nachnahme unset($nn_gebuehr); $orders_shipping_nn = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where class = 'ot_cod_fee' and orders_id = " . $Orders_id); //$row_orders_shipping_nn = tep_db_fetch_array($orders_shipping_nn); while($row_orders_shipping_nn = mysql_fetch_array($orders_shipping_nn)) { // end // $nn_gebuehr = $row_orders_shipping_nn["value"]; } // -------------------- QUERIES 5c ------------------------------------// //Orders_Shipping_Minderwert bei Auslandsaufträgen unset($minderwert); $orders_shipping_minderwert = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where class = 'ot_loworderfee' and orders_id = " . $Orders_id); //$row_orders_shipping_minderwert = tep_db_fetch_array($orders_shipping_minderwert); while($row_orders_shipping_minderwert = mysql_fetch_array($orders_shipping_minderwert)) { // end // $minderwert = $row_orders_shipping_minderwert["value"]; } // -------------------- QUERIES 5d ------------------------------------// //Orders_Coupon Rabatt bei Couponeinsatz unset($coupon); $orders_coupon = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where class = 'ot_discount_coupon' and orders_id = " . $Orders_id); //$row_orders_coupon = tep_db_fetch_array($orders_coupon); while($row_orders_coupon = mysql_fetch_array($orders_coupon)) { // end // $coupon = $row_orders_coupon["value"]; } // -------------------- QUERIES 6 ------------------------------------// //Orders_Residential Del Fee (Giftwrap) $orders_residential_fee = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where class = 'ot_giftwrap' and orders_id = " . $Orders_id); //$row_orders_residential_fee = tep_db_fetch_array($orders_residential_fee); while($row_orders_residential_fee = mysql_fetch_array($orders_residential_fee)) { // end // $Small_Order_Fee = $row_orders_residential_fee["value"]; } //////////////////////////////////// $Discount_Rate = ""; $Discount_Message = ""; $CODAmount = ""; // -------------------- QUERIES 7 ------------------------------------// //Orders_Total Gesamtbetrag der Bestellung wird noch nicht gebraucht $orders_total = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where class = 'ot_total' and orders_id = " . $Orders_id); //$row_orders_total = tep_db_fetch_array($orders_total); while($row_orders_total = mysql_fetch_array($orders_total)) { // end // $Order_Grand_Total = $row_orders_total["value"]; } // -------------------- QUERIES 8 ------------------------------------// //Kundendaten wie Name, Faxnummer und Refferer $customers = tep_db_query("select customers_gender, customers_firstname, customers_lastname, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = " . $customers_id); //$row_customers = tep_db_fetch_array($customers); while($row_customers = mysql_fetch_array($customers)) { // end // $fax = $row_customers["customers_fax"]; $gender = $row_customers["customers_gender"]; $kvorname = $row_customers["customers_firstname"]; $knachname = $row_customers["customers_lastname"]; } // -------------------- QUERIES 9 ------------------------------------// //Products COunt $orders_count = tep_db_query("select count(products_quantity) as o_count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = " . $Orders_id); //$row_orders_total = tep_db_fetch_array($orders_total); while($row_orders_count = mysql_fetch_array($orders_count)) { // end // $Number_of_Items = $row_orders_count[0]; // used array to show the number of items ordered } // $Shipping_Weight = ""; $Coupon_Code = ""; $Order_security_msg = ""; $Order_Surcharge_Amount = ""; $Order_Surcharge_Something = ""; $Affiliate_code = ""; $Sentiment_message = ""; $Checkout_form_type = ""; $future1 = " "; $future2 = ""; $future3 = ""; $future4 = ""; $future5 = ""; $future6 = ""; $future7 = ""; $future8 = ""; $future9 = ""; // csv settings //$CSV_SEPARATOR = ";"; //$CSV_NEWLINE = "\r\n"; //$csv_output .= $Orders_id . $delim; //$csv_output .= $Date . $delim; //$csv_output .= $Time . $delim; //$csv_output .= $customers_id . $delim; //$csv_output .= $gender . $delim; //$csv_output .= $kvorname . $delim; //$csv_output .= $knachname . $delim; //$csv_output .= $Company . $delim; //$csv_output .= $email . $delim; //$csv_output .= $Billing_Address_1 . $delim; //$csv_output .= $Billing_Address_2 . $delim; //$csv_output .= $Billing_City . $delim; //$csv_output .= $Billing_State . $delim; //$csv_output .= $Billing_Zip . $delim; //$csv_output .= $Billing_Country . $delim; //$csv_output .= $Billing_Phone . $delim; //$csv_output .= $fax . $delim; //$csv_output .= $ShipTo_First_Name . $delim; //$csv_output .= $ShipTo_Last_Name . $delim; //$csv_output .= $ShipTo_Name . $delim; //$csv_output .= $ShipTo_Company . $delim; //$csv_output .= $ShipTo_Address_1 . $delim; //$csv_output .= $ShipTo_Address_2 . $delim; //$csv_output .= $ShipTo_City . $delim; //$csv_output .= $ShipTo_State . $delim; //$csv_output .= $ShipTo_Zip . $delim; //$csv_output .= $ShipTo_Country . $delim; //$csv_output .= $ShipTo_Phone . $delim; //$csv_output .= $Card_Type . $delim; //$csv_output .= $Card_Number . $delim; //$csv_output .= $Exp_Date . $delim; //$csv_output .= $Bank_Name . $delim; //$csv_output .= $Gateway . $delim; //$csv_output .= $AVS_Code . $delim; //$csv_output .= $Transaction_ID . $delim; //$csv_output .= $payment . $delim; //$csv_output .= $Order_Special_Notes . $delim; //$csv_output .= $Comments . $delim; //$csv_output .= $Order_Subtotal . $delim; //$csv_output .= $Order_Tax . $delim; //$csv_output .= $Order_Insurance . $delim; //$csv_output .= $Tax_Exempt_Message . $delim; //$csv_output .= $Order_Shipping_Total . $delim; //$csv_output .= $nn_gebuehr . $delim; //$csv_output .= $minderwert . $delim; //$csv_output .= $coupon . $delim; //$csv_output .= $Small_Order_Fee . $delim; //$csv_output .= $Discount_Rate . $delim; //$csv_output .= $Discount_Message . $delim; //$csv_output .= $CODAmount . $delim; //$csv_output .= $Order_Grand_Total . $delim; //$csv_output .= $Number_of_Items . $delim; //$csv_output .= $Shipping_Method . $delim; //$csv_output .= $Shipping_Weight . $delim; //$csv_output .= $Coupon_Code . $delim; //$csv_output .= $Order_security_msg . $delim; //$csv_output .= $Order_Surcharge_Amount . $delim; //$csv_output .= $Order_Surcharge_Something . $delim; //$csv_output .= $Affiliate_code . $delim; //$csv_output .= $Sentiment_message . $delim; //$csv_output .= $Checkout_form_type . $delim; //$csv_output .= $productname . $delim; //$csv_output .= $products_price . $delim; // -------------------- QUERIES 10 ------------------------------------// //Get list of products ordered $orders_products = tep_db_query("select orders_products_id, products_model, products_price, products_quantity, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = " . $Orders_id); $productname = $row_customers["products_name"]; $order_num = $Orders_id; // While loop to list the item $csv_output .= $open_table; $csv_output .= $open_header; if($submitted == 2){ // Html output to screen $csv_output .= "<td width=20>Order ID".$delim; $csv_output .= "<td width=50>Date".$delim; $csv_output .= "<td width=100>Bill Name".$delim; $csv_output .= "<td width=100>Last".$delim; $csv_output .= "<td width=100>Address1".$delim; $csv_output .= "<td width=25>Address2".$delim; $csv_output .= "<td width=100>City".$delim; $csv_output .= "<td width=100>State".$delim; $csv_output .= "<td width=25>Zip".$delim; $csv_output .= "<td width=100>Phone".$delim; $csv_output .= "<td width=100>Ship Name".$delim; $csv_output .= "<td width=100>Address1".$delim; $csv_output .= "<td width=25>Address2".$delim; $csv_output .= "<td width=100>City".$delim; $csv_output .= "<td width=100>State".$delim; $csv_output .= "<td width=25>Zip".$delim; $csv_output .= "<td width=100>Ship Method".$delim; $csv_output .= "<td width=25>Ship Cost".$delim; } $csv_output .= $close_header; $csv_output .= $submitted == 1 ? $open_column.$order_num.$delim : $open_column."<a href=".$order_url.$order_num.$order_edit.">".$order_num."</a>".$delim; $csv_output .= $open_column.$Date . $delim; $csv_output .= $open_column.$kvorname . " " . $knachname . $delim; $csv_output .= $open_column.$Billing_Address_1 . $delim; $csv_output .= $open_column.$Billing_Address_2 . $delim; $csv_output .= $open_column.$Billing_City . $delim; $csv_output .= $open_column.$Billing_State . $delim; $csv_output .= $open_column.$Billing_Zip . $delim; $csv_output .= $open_column.$Billing_Phone . $delim; $csv_output .= $open_column.$ShipTo_First_Name . " " .$ShipTo_Last_Name. $delim; $csv_output .= $open_column.$ShipTo_Address_1 . $delim; $csv_output .= $open_column.$ShipTo_Address_2 . $delim; $csv_output .= $open_column.$ShipTo_City . $delim; $csv_output .= $open_column.$ShipTo_State . $delim; $csv_output .= $open_column.$ShipTo_Zip . $delim; $csv_output .= $open_column.$Shipping_Method . $delim; $csv_output .= $open_column.$Order_Shipping_Total . $delim; $csv_output .= $open_header; if($submitted == 2){ // Html output to screen $csv_output .= "<td width=100>Model".$delim; $csv_output .= "<td width=25>Qty".$delim; $csv_output .= "<td width=250>Product".$delim; $csv_output .= "<td width=100>Price".$delim; } $csv_output .= $close_header; while($row_orders_products = mysql_fetch_array($orders_products)) { /* if($row_orders_products[0] != ""){ // if */ //$csv_output .= $open_column.$order_url.$order_num.$order_edit . $delim; $csv_output .= $open_column.filter_text($row_orders_products[0]) . $delim; $csv_output .= $open_column.$row_orders_products[1] . $delim; $csv_output .= $open_column.filter_text($row_orders_products[3]) . $delim; $csv_output .= $open_column.filter_text($row_orders_products[2]) . $delim; $csv_output .= $open_column.filter_text($row_orders_products[4]) . $delim; $csv_output .= $submitted == 1 ? "" : ""; $csv_output .= "\n"; $csv_output .= $open_column.$order_num . $delim; $csv_output .= $open_column.$Date . $delim; $csv_output .= $open_column.$kvorname . " " . $knachname . $delim; $csv_output .= $open_column.$Billing_Address_1 . $delim; $csv_output .= $open_column.$Billing_Address_2 . $delim; $csv_output .= $open_column.$Billing_City . $delim; $csv_output .= $open_column.$Billing_State . $delim; $csv_output .= $open_column.$Billing_Zip . $delim; $csv_output .= $open_column.$Billing_Phone . $delim; $csv_output .= $open_column.$ShipTo_First_Name . " " .$ShipTo_Last_Name. $delim; $csv_output .= $open_column.$ShipTo_Address_1 . $delim; $csv_output .= $open_column.$ShipTo_Address_2 . $delim; $csv_output .= $open_column.$ShipTo_City . $delim; $csv_output .= $open_column.$ShipTo_State . $delim; $csv_output .= $open_column.$ShipTo_Zip . $delim; $csv_output .= $open_column.$Shipping_Method . $delim; $csv_output .= $open_column.$Order_Shipping_Total . $delim; /* } // end if */ } // end while loop for products $csv_output .= $close_table; $csv_output .= $submitted == 1 ? "" : "<br>"; // --------------------------------------------------------------------------// $csv_output .= "\n"; } // while loop main first //BOF OUTPUT if($submitted == 1){ header("Content-Type: application/force-download\n"); header("Cache-Control: cache, must-revalidate"); header("Pragma: public"); header("Content-Disposition: attachment; filename=orders_" . date("dmY") . ".csv"); print $csv_output; } elseif($submitted == 2){ $csv_output = str_replace("\n", "<br>", $csv_output); echo "<p dir=rtl>".$csv_output."</p>"; } exit; //EOF OUTPUT }//function main function filter_text($text) { $filter_array = array(",","\r","\n","\t"); return str_replace($filter_array,"",$text); } // function for the filter ?> Something definitely work and that line disappears. Unfrotunately it scrunches everything up on 1 line.
  5. dvharrison

    Does each order line have a unique ID number

    That snippet I gave you was the part right at the end of the file. The actual page is about 594 lines long. I could print it if you'd like. So you're saying it needs to go before the closing ?> I shall see what happens.
  6. dvharrison

    Does each order line have a unique ID number

    No I have had a play and all that does it compress allthe info on one line. Maybe I am just going about this the wrong way.
  7. dvharrison

    Does each order line have a unique ID number

    Ok Just so i am clear, where do I add this? Right at the end? I have had a play and it appears to stuff everything on 1 line (what I need to avoid). Last bit of script is this: $csv_output .= $close_header; $csv_output .= $submitted == 1 ? $open_column.$order_num.$delim : $open_column."<a href=".$order_url.$order_num.$order_edit.">".$order_num."</a>".$delim; $csv_output .= $open_column.$Date . $delim; $csv_output .= $open_column.$kvorname . " " . $knachname . $delim; $csv_output .= $open_column.$Billing_Address_1 . $delim; $csv_output .= $open_column.$Billing_Address_2 . $delim; $csv_output .= $open_column.$Billing_City . $delim; $csv_output .= $open_column.$Billing_State . $delim; $csv_output .= $open_column.$Billing_Zip . $delim; $csv_output .= $open_column.$Billing_Phone . $delim; $csv_output .= $open_column.$ShipTo_First_Name . " " .$ShipTo_Last_Name. $delim; $csv_output .= $open_column.$ShipTo_Address_1 . $delim; $csv_output .= $open_column.$ShipTo_Address_2 . $delim; $csv_output .= $open_column.$ShipTo_City . $delim; $csv_output .= $open_column.$ShipTo_State . $delim; $csv_output .= $open_column.$ShipTo_Zip . $delim; $csv_output .= $open_column.$Shipping_Method . $delim; $csv_output .= $open_column.$Order_Shipping_Total . $delim; $csv_output .= $open_header; if($submitted == 2){ // Html output to screen $csv_output .= "<td width=100>Model".$delim; $csv_output .= "<td width=25>Qty".$delim; $csv_output .= "<td width=250>Product".$delim; $csv_output .= "<td width=100>Price".$delim; } $csv_output .= $close_header; while($row_orders_products = mysql_fetch_array($orders_products)) { //$csv_output .= $open_column.$order_url.$order_num.$order_edit . $delim; $csv_output .= $open_column.filter_text($row_orders_products[0]) . $delim; $csv_output .= $open_column.$row_orders_products[1] . $delim; $csv_output .= $open_column.filter_text($row_orders_products[3]) . $delim; $csv_output .= $open_column.filter_text($row_orders_products[2]) . $delim; $csv_output .= $open_column.filter_text($row_orders_products[4]) . $delim; $csv_output .= $submitted == 1 ? "" : ""; $csv_output .= "\n"; $csv_output .= $open_column.$order_num . $delim; $csv_output .= $open_column.$Date . $delim; $csv_output .= $open_column.$kvorname . " " . $knachname . $delim; $csv_output .= $open_column.$Billing_Address_1 . $delim; $csv_output .= $open_column.$Billing_Address_2 . $delim; $csv_output .= $open_column.$Billing_City . $delim; $csv_output .= $open_column.$Billing_State . $delim; $csv_output .= $open_column.$Billing_Zip . $delim; $csv_output .= $open_column.$Billing_Phone . $delim; $csv_output .= $open_column.$ShipTo_First_Name . " " .$ShipTo_Last_Name. $delim; $csv_output .= $open_column.$ShipTo_Address_1 . $delim; $csv_output .= $open_column.$ShipTo_Address_2 . $delim; $csv_output .= $open_column.$ShipTo_City . $delim; $csv_output .= $open_column.$ShipTo_State . $delim; $csv_output .= $open_column.$ShipTo_Zip . $delim; $csv_output .= $open_column.$Shipping_Method . $delim; $csv_output .= $open_column.$Order_Shipping_Total . $delim; } // end while loop for products $csv_output .= $close_table; $csv_output .= $submitted == 1 ? "" : "<br>"; // --------------------------------------------------------------------------// $csv_output .= "\n"; } // while loop main first //BOF OUTPUT if($submitted == 1){ header("Content-Type: application/force-download\n"); header("Cache-Control: cache, must-revalidate"); header("Pragma: public"); header("Content-Disposition: attachment; filename=orders_" . date("mdY") . ".csv"); print $csv_output; } elseif($submitted == 2){ $csv_output = str_replace("\n", "<br>", $csv_output); echo "<p dir=rtl>".$csv_output."</p>"; } exit; //EOF OUTPUT }//function main function filter_text($text) { $filter_array = array(",","\r","\n","\t"); return str_replace($filter_array,"",$text); } // function for the filter ?> Sorry to ask such dumb questions but thats just me. :)
  8. dvharrison

    Does each order line have a unique ID number

    You've confused me now. The guy at Tradeboc said this: I have accomplished this all bar an empty line at the bottom of each order. I hope this is clearer. Many thanks ;)
  9. dvharrison

    Does each order line have a unique ID number

    Well, I have the page that creates the delimited file and I seem to be successful thus far. <_< Getting a bit technical, I need the order line loop to end if only 1 product line is ordered (otherwise the following header information carried onto a blank line. I am assuming its an if else function. Relevant PHP is here: } $csv_output .= $close_header; $csv_output .= $submitted == 1 ? $open_column.$order_num.$delim : $open_column."<a href=".$order_url.$order_num.$order_edit.">".$order_num."</a>".$delim; $csv_output .= $open_column.$Date . $delim; $csv_output .= $open_column.$kvorname . " " . $knachname . $delim; $csv_output .= $open_column.$Billing_Address_1 . $delim; $csv_output .= $open_column.$Billing_Address_2 . $delim; $csv_output .= $open_column.$Billing_City . $delim; $csv_output .= $open_column.$Billing_State . $delim; $csv_output .= $open_column.$Billing_Zip . $delim; $csv_output .= $open_column.$Billing_Phone . $delim; $csv_output .= $open_column.$ShipTo_First_Name . " " .$ShipTo_Last_Name. $delim; $csv_output .= $open_column.$ShipTo_Address_1 . $delim; $csv_output .= $open_column.$ShipTo_Address_2 . $delim; $csv_output .= $open_column.$ShipTo_City . $delim; $csv_output .= $open_column.$ShipTo_State . $delim; $csv_output .= $open_column.$ShipTo_Zip . $delim; $csv_output .= $open_column.$Shipping_Method . $delim; $csv_output .= $open_column.$Order_Shipping_Total . $delim; $csv_output .= $open_header; if($submitted == 2){ // Html output to screen $csv_output .= "<td width=100>Model".$delim; $csv_output .= "<td width=25>Qty".$delim; $csv_output .= "<td width=250>Product".$delim; $csv_output .= "<td width=100>Price".$delim; } $csv_output .= $close_header; while($row_orders_products = mysql_fetch_array($orders_products)) { //$csv_output .= $open_column.$order_url.$order_num.$order_edit . $delim; $csv_output .= $open_column.filter_text($row_orders_products[0]) . $delim; $csv_output .= $open_column.$row_orders_products[1] . $delim; $csv_output .= $open_column.filter_text($row_orders_products[3]) . $delim; $csv_output .= $open_column.filter_text($row_orders_products[2]) . $delim; $csv_output .= $open_column.filter_text($row_orders_products[4]) . $delim; $csv_output .= $submitted == 1 ? "" : ""; $csv_output .= "\n"; // If else Needed on this line!! $csv_output .= $open_column.$order_num . $delim; $csv_output .= $open_column.$Date . $delim; $csv_output .= $open_column.$kvorname . " " . $knachname . $delim; } // end while loop for products $csv_output .= $close_table; $csv_output .= $submitted == 1 ? "" : "<br>"; I would soo appreciate any knowledge here. As I said I am a PHP newbie but can follow patterns and use common sense. When I have completed this I shall share the page on the addon as tradeBox Finance Manager must be used by more than 1 person in the community (Surely!).
  10. dvharrison

    Does each order line have a unique ID number

    After having a play, the order_products_id seems to be the unique identifier that I need. Now I've just got to work out how to add each product ordered onto separate lines and I should be sorted. Newbie question: Any ideas how I do this? ;)
  11. dvharrison

    Does each order line have a unique ID number

    Thanks for your help Jim So are products_id and orders_products_id one of the same thing? I am looking for a unique identifier for each line placed in an order.
  12. dvharrison

    Does each order line have a unique ID number

    I have looked in the database and under orders_products, there are the fields orders_products_id and products_id. I am assuming that one is the part number (to which we've got and the other is a unique identifier to the product line number. Is that correct?
  13. dvharrison

    Export orders into csv

    Yes it was, but does anyone have any idea how I can achieve assigning an item idea for every additional line of an order?
  14. dvharrison

    Export orders into csv

    I have found http://addons.oscommerce.com/info/4728 which does it with no whitespace, but for orders with more than 1 line I need them on a separate line with a separate transaction number. Can anyone help with this, or even better, PM me with a quote for how much this would cost. :)
  15. dvharrison

    Export orders into csv

    I have been using this but in order for it to do what we want I need to a. get rid of all the whitespace and b. when a client has bought more than 1 item, each product purchased needs to appear in a separate line. Can anyone do this or can someone guide me into how to do this. I have basic PHP knowledge and pick things up very quickly. Many thanks in advance
  16. dvharrison

    Export Orders - Is it possible? Urgent!

    Hi aka sharkbow Either http://addons.oscommerce.com/info/4728 or http://addons.oscommerce.com/info/4181 Hope this helps.
  17. dvharrison

    Optimization of tep_get_tax_rate()

    I want to use this add-on so I can get Sage CSV working. However, I am having trouble modifying the includes/functions/general.php page. Basically its asking me to add: When I have listed: and When I have: I have multi shipping zones basically spanning the english and scottish islands. Is this not going to disrupt it? if so, is there an alternative I can add? Any help gratefully received. TIA
  18. dvharrison

    Official PayPal IPN Support Thread

    Hi Satish Have you checked out the link I mentioned earlier? http://forums.oscommerce.com/index.php?sho...rt=#entry730465 Sections 6 and 11 cover downloads/order status. Hope this helps.
  19. dvharrison

    Official PayPal IPN Support Thread

    hey David Fellow Essex, eh? Is it easier for me to shout this out of the door? :lol: Whichever contribution you are using (I am assuming http://addons.oscommerce.com/info/282) have you tried approaching the recent programmer/contributor to that particular add-on? I have no idea if this breaches etiquette rules on this forum (and if it does then apologies), but as no rules seem to be available, so I think this might be a good place to start if you aren't a PHP developer. Hope this helps.
  20. dvharrison

    Official PayPal IPN Support Thread

    Hi David I have just finished configuring this pesky thing for a few weeks, so hopefully I can chime in with what has been a steep learning curve. :D Regarding the discounts bit. What setup/add-on are you using for the discounts? There was a recent patch update resolving a conflict between IPN and 2 discount add-ons. (drex's add-on from 26 April) I also read somewhere about not turning stuff on in PayPal, but if you go to the Instant PayPal Notification preferences in your PayPal account, you have to add the URL to the path eg http://yourdomain/catalog/includes/modules.../paypal_ipn.php (which gets payPal to communicate with your site) and a return URL (taking you back to the site). PayPal does get huffy if you have any shipping calculations set up in the PayPal account. Also is permissions on your /tmp folder set to 777? 2 guides I have found to be a gospel over the last few days are: http://forums.oscommerce.com/index.php?sho...=0&p=730503 - which is a payPal IPN and downloads guide, but confirms what I've just covered above. http://forums.oscommerce.com/index.php?showtopic=166092 - which tackles encryption. I hope this helps and good luck! ;)
  21. dvharrison

    Official PayPal IPN Support Thread

    hi Nic I removed the add-on accumulating that code and I am still getting a 500 error. I think I may have to remove the IPN plug-in and look for another method, because this is unsettling.
  22. dvharrison

    Official PayPal IPN Support Thread

    Hi Nic My .htaccess reads as follows: # $Id: .htaccess 1739 2007-12-20 00:52:16Z hpdl $ # # This is used with Apache WebServers # # For this to work, you must include the parameter 'Options' to # the AllowOverride configuration # # Example: # # <Directory "/usr/local/apache/htdocs"> # AllowOverride Options # </Directory> # # 'All' with also work. (This configuration is in the # apache/conf/httpd.conf file) # The following makes adjustments to the SSL protocol for Internet # Explorer browsers #<IfModule mod_setenvif.c> # <IfDefine SSL> # SetEnvIf User-Agent ".*MSIE.*" \ # nokeepalive ssl-unclean-shutdown \ # downgrade-1.0 force-response-1.0 # </IfDefine> #</IfModule> # If Search Engine Friendly URLs do not work, try enabling the # following Apache configuration parameter # AcceptPathInfo On # Fix certain PHP values # (commented out by default to prevent errors occuring on certain # servers) # php_value session.use_trans_sid 0 # php_value register_globals 1 # anti xss script 1 - pci compliance - by pixclinic Options +FollowSymLinks RewriteEngine On RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR] RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) RewriteRule ^(.*)$ index_error.php [F,L] RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] # extra anti uri and xss attack script 2 - sql injection prevention Options +FollowSymLinks RewriteEngine On RewriteCond %{QUERY_STRING} ("|%22).*(>|%3E|<|%3C).* [NC] RewriteRule ^(.*)$ log.php [NC] RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC] RewriteRule ^(.*)$ log.php [NC] RewriteCond %{QUERY_STRING} (java script:).*(;).* [NC] RewriteRule ^(.*)$ log.php [NC] RewriteCond %{QUERY_STRING} (;|'|"|%22).*(union|select|insert|drop|update|md5|benchmark|or|and|if).* [NC] RewriteRule ^(.*)$ log.php [NC] RewriteRule (,|;|<|>|'|`) /log.php [NC] I have no idea if that sheds any light on what the problem could be.
  23. dvharrison

    Official PayPal IPN Support Thread

    I am going through the troubleshooting section and the ext/modules/payment/paypal_ipn/ipn.php page is showing a 500 internal server error. The ext folder is CHMOD 755 (which is standard for my server) the actualy page CHMOD is 644. Using latest paypal addon (2.3.4.7) I am using a United Hosting standard account that uses PHP5 and I am just finding out id Register Globals is on or off. I have recently made the last 2 changes on the folder (as we use the price sensitive discount) but still stock is not deducting. Please help. If I cannot sort this then I am going to have to uninstall this add-on and try something else (which would be a shame).
  24. dvharrison

    UltraPic In IE8

    --Deleted as I'm having a bad day and posted to the wrong post.-- Sorry
  25. dvharrison

    UltraPic In IE8

    Hi Steve Nothing I can put my finger on, but a couple of Suggestions: I've never heard of that attribute and it isn't listed on W3 schools I also ran an HTML validator from Firefox and it picks up 67 warnings, 2 of which are missing </div> tags which normally cause problems. If not then is this an add-on, and if so, does the add-on have a support thread (or a contactable person)? Hope this helps.
×