All pastes #357778 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-02-15 22:22 UTC
rendered paste body
$orders_products = tep_db_query("SELECT op.products_model, op.final_price, op.products_quantity, op.products_name, opa.products_options, opa.products_options_values, op.orders_products_id FROM orders_products op left join orders_products_attributes opa on (op.orders_products_id = opa.orders_products_id) WHERE op.orders_id = " . $Orders_id);



// While loop to list the item

while($row_orders_products = mysql_fetch_array($orders_products)) {


if ($row_orders_products[6] == $control) {
 	$csv_output .= filter_text($row_orders_products[4]) . $delim ; // PRODUCT ATTRIBUTE OPTIONS
	$csv_output .= filter_text($row_orders_products[5]) . $delim ; // PRODUCT ATTRIBUTE VALUES
	}
else {

$csv_output .= $row_orders_products[6] . $delim ;  // products id
$csv_output .= $row_orders_products[2] . $delim ; // QUANTITY
$csv_output .= filter_text($row_orders_products[0]) . $delim ; // BASIC SKU
$csv_output .= filter_text($row_orders_products[3]) . $delim ;  // PRODUCT NAME
$csv_output .= filter_text($row_orders_products[4]) . $delim ; // PRODUCT ATTRIBUTE OPTIONS
$csv_output .= filter_text($row_orders_products[5]) . $delim ; // PRODUCT ATTRIBUTE VALUES
$csv_output .= $row_orders_products[1] . $delim ; // FINAL PRICE
$csv_output .= "<br>";
}

//control
$control = $row_orders_products[6];



} // end while loop for products