I am working on an osCommerce site which offers a few products and a variety of music classes. Each product and class is processed in the usual way, but an additional process is added which is supposed to send a separate email for each item or class purchased. The emails contain details about the product or the class. The function, doemail(), is attached. The problem is that when a user orders multiple items, only the email for the first item ordered is sent. The other items appear to be ignored.
The function first searches the database for the items contained in the order. It then enters a while loop. Inside the loop, a switch statement assigns values for various parameters associated with the item referenced in the row being examined. Next, a series of conditional routines, compose the message to be sent in the email. Finally, the email is supposed to be sent and the loop begins again with the next row.
As noted, the function works well for the first row, but fails to function after that. No error messages are generated on-screen.