Hi,
I just about have what I want to do figured out, and am after a pointer on how to create a variable properly from a function.
The function.
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
// Added 5/2004 Get Image from Data Base CED
$products_query_raw = "select p.products_image, p.products_cost from " . TABLE_PRODUCTS . " p where products_model =" . "'" . $order->products[$i]['model'] . "'";
$products_query = tep_db_query($products_query_raw);
$products = tep_db_fetch_array($products_query);
// Added 5/2004 Get Image from Data Base CED
echo $order->products[$i]['qty'] . ' ' . "\n" . $order->products[$i]['name'] . ' ' . "\n" . substr($order->products[$i]['model'],3,7) . '' . "\n" . '$ ' . $products['products_cost'] . ' ' . "\n\n" . "\n\n";
}
I want it to look something like
$ordertotal = for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
// Added 5/2004 Get Image from Data Base CED
$products_query_raw = "select p.products_image, p.products_cost from " . TABLE_PRODUCTS . " p where products_model =" . "'" . $order->products[$i]['model'] . "'";
$products_query = tep_db_query($products_query_raw);
$products = tep_db_fetch_array($products_query);
// Added 5/2004 Get Image from Data Base CED
echo $order->products[$i]['qty'] . ' ' . "\n" . $order->products[$i]['name'] . ' ' . "\n" . substr($order->products[$i]['model'],3,7) . '' . "\n" . '$ ' . $products['products_cost'] . ' ' . "\n\n" . "\n\n";
}
And then use this variable in an email.
Any pointers would be apprecaited, when I tried the above I get unexpected T_FOR errors.