You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
I am trying to display the current status of an order listed in the when a customer is logged into their account.
I replaced <tracking_time> with <tracking_status> in ##Ste Custacct Orders## as shown below and it works great... but how do I show the status as "Need Payment" instead of "N", etc. etc.?
Thanks in advance!!
#######################################################################
# Ste Custacct Orders #
#######################################################################
sub ste_custacct_orders {
&initialize_sub_add('ste_custacct_orders');
#########
######### This routine prints a listing of previous orders.
#########
my $count = "0";
#########
######### First get info on orders where the email address
######### is the same as the logged in user.
#########
$dbins_tracking_email = database_quote('tracking',$fd_act);
$sql_statement = "
SELECT tracking_id,tracking_date,tracking_status,tracking_email,tracking_total
FROM tracking
WHERE tracking_email=$dbins_tracking_email
";
my @tracking = database_call('tracking','SELECT',$sql_statement);
foreach $row(@tracking) {
($tracking_id,$tracking_date,$tracking_status,$tracking_email,$tracking_total) = @$row;
$count++;
} ######### End of foreach statement.
if ($count ne "0") {
&display_print('ste_custacct_ordh');
my $row_count = "2";
foreach $row(@tracking) {
($tracking_id,$tracking_date,$tracking_status,$tracking_email,$tracking_total) = @$row;
if ($row_count eq "1") {
print "<TR BGCOLOR=\"$html_pri_tablerow_color\">\n";
} else {
print "<TR BGCOLOR=\"$html_alt_tablerow_color\">\n";
} ######### End of if statement.
$encoded_tracking_id = vars_urlencode($tracking_id);
$encoded_tracking_email = vars_urlencode($tracking_email);
print <<ENDOFTEXT;
<TD VALIGN="TOP"><FONT FACE="$html_small_font_face" SIZE="$html_small_font_size" COLOR="$html_small_font_color"><A HREF="$common_url&pg=ste_nolay_orderinv&tracking_id=$encoded_tracking_id&tracking_email=$encoded_tracking_email" TARGET="_blank">$tracking_id</A></FONT></TD>
ENDOFTEXT
print <<ENDOFTEXT;
<TD VALIGN="TOP"><FONT FACE="$html_small_font_face" SIZE="$html_small_font_size" COLOR="$html_small_font_color">$tracking_date</FONT></TD>
ENDOFTEXT
print <<ENDOFTEXT;
<TD VALIGN="TOP"><FONT FACE="$html_small_font_face" SIZE="$html_small_font_size" COLOR="$html_small_font_color">$display_tracking_status</FONT></TD>
ENDOFTEXT
print <<ENDOFTEXT;
<TD VALIGN="TOP"><FONT FACE="$html_small_font_face" SIZE="$html_small_font_size" COLOR="$html_small_font_color">$currency_symbol$tracking_total</FONT></TD>
ENDOFTEXT
if ($row_count eq "2") {
$row_count = "1";
} else {
$row_count++;
} ######### End of if statement.
print "</TR>\n";
} ######### End of foreach statement.
&display_print('ste_custacct_ordf');
} ######### End of if statement.
&initialize_sub_remove('ste_custacct_orders');
} ######### End of subroutine.
Offline
That could probably be done by importing a routine with sub require command into your ste_custacct.pl file.
Offline
Damn.... wrong forum. Can this get moved to 5.1 forums?
Offline
Nick could.
Offline
No.... I changed it back to $tracking_status and it's now just showing the Tracking Letter mentiond above.
Offline
Right below:
($tracking_id,$tracking_date,$tracking_status,$tracking_email,$tracking_total) = @$row;
You could add:
if ($tracking_status eq "C") {$tracking_status = "Completed";} elsif ($tracking_status eq "P") {$tracking_status = "Pending Payment";} ...and so on to match your status values...
Offline
Thank you Nick... works perfect....
Note the new code needs to be added after the 2nd instance of:
($tracking_id,$tracking_date,$tracking_status,$tracking_email,$tracking_total) = @$row;
not the first.
Offline