PDA

View Full Version : Order Status / Receipt Page for non-member customers


mrscripto
January 14th, 2004, 02:13 AM
After many customer emails stating "Did my order ship, and can I have a tracking number", I decided to create a receipt page for my non-member customers so they can view their order status and I can add to the Shipping Instructions and leave them a tracking number.

90% percent of my customers use the quick checkout, so they have no way of knowing when their order shipped or what their tracking number is.

So I added a link in the customer email receipt that has their order number included. They have to login by entering their email (the email address used in the order) to gain access, so it's somewhat secure.

My question is... when reading the Shipping_Details from the Orders database and echoing it to the browser, I lose the format, line returns to be exact. So my Order Details comes out as one continuous line. Does anyone know how to keep the format when outputting to HTML??

View the page here: http://www.sillytown.com/trackit.php
Use the order number 3036, and email address test@email.com to view a test order.

Thanks!

Jamie
January 14th, 2004, 01:40 PM
Hi,

Nice work. We will be adding something similar in the future. To convert line breaks to html break tags via php, use the nl2br() function (new line to break):

<?
$text = "this is text
with regular
plain text
line breaks";
$text = nl2br($text);
print $text;
?>

More info on the function here:
http://us4.php.net/manual/en/function.nl2br.php

Thanks.
Jamie

mrscripto
January 14th, 2004, 06:53 PM
Jamie
Thanks! Worked like a charm.
This will hopefully make my customers very happy, and cut down on the emails I have to respond to.

Darin