Latest News: (loading..)

crumplezone

Members
  • Content count

    8
  • Joined

  • Last visited

  1. There are clearly some errors in the original contribution. I found I was also getting blank CSVs until I used the code from ecommunlimited above. However, I am trying to get it to export other fields. I am trying to get enough info into the CSV for it to work with Royal Mail Click & Drop, but I'm not 100% sure exactly what is needed yet. I tried uncommenting the fields below $csv_output .= "Product_Id".$delim; $csv_output .= "Product_Price".$delim; $csv_output .= "Number".$delim; $csv_output .= "Product".$delim; $csv_output .= "Attribute".$delim; $csv_output .= "Attribute_Value".$delim; But am just getting the headers on the CSV, but no data in the columns below. I have also tried to get the queries 9 section to work with no results. I notice that this section still uses mysql_fetch_array in two places instead of tep_db_fetch_array which has replaced it in the rest of the code. However, when I replace these in queries 9, I get 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 2 select products_options, products_options_values from orders_products_attributes where orders_id = 2 and orders_products_id = [TEP STOP] Here's the code for queries 9 //Get list of products ordered $orders_products = tep_db_query("select products_model, products_price, products_quantity, products_name, orders_products_id from orders_products where orders_id = " . $Orders_id); // While loop to list the item $countproducts = 0; $csv_output_item = ""; $csv_output_order = str_replace($csv_output_ordersbefore, "", $csv_output); while($row_orders_products = mysql_fetch_array($orders_products)) { // loop through orders // More than one product per order, new line if ($countproducts>0){ $csv_output .= "\n"; $csv_output .= $csv_output_order; $csv_output_item = ""; } $csv_output_item .= "," . "BEGIN_ITEM". "," ; $csv_output_item .= ","; $csv_output_item .= filter_text($row_orders_products[0]) . ";" ; $csv_output_item .= $row_orders_products[1] . ";" ; $csv_output_item .= $row_orders_products[2] . ";" ; $csv_output_item .= filter_text($row_orders_products[3]) . ";" ; $Products_id = $row_orders_products[4]; $orders_products_attributes = tep_db_query("select products_options, products_options_values from orders_products_attributes where orders_id = " . $Orders_id . " and orders_products_id = " . $Products_id); while($row_orders_products_attributes = mysql_fetch_array($orders_products_attributes)) { $csv_output_item .= filter_text($row_orders_products_attributes[0]) . "," ; $csv_output_item .= filter_text($row_orders_products_attributes[1]) . "," ; } $csv_output_item .= "END_ITEM"; $csv_output .= $csv_output_item; $countproducts += 1; } // end while loop for products Any help greatly appreciated.