Kryptronic Software Support Forum

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.

#1 04-03-2004 19:06:23

48hourprint
Member
Registered: 02-03-2003
Posts: 22

Order Status In Customer Accounts

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

 

#2 04-03-2004 21:14:44

scoutch
Member
Registered: 07-03-2003
Posts: 3167

Re: Order Status In Customer Accounts

That could probably be done by importing a routine with sub require command into your ste_custacct.pl file.


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#3 04-03-2004 21:24:08

48hourprint
Member
Registered: 02-03-2003
Posts: 22

Re: Order Status In Customer Accounts

Damn.... wrong forum. Can this get moved to 5.1 forums?

Offline

 

#4 04-03-2004 21:36:40

scoutch
Member
Registered: 07-03-2003
Posts: 3167

Re: Order Status In Customer Accounts

Nick could.


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#5 04-09-2004 08:07:49

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19872
Website

Re: Order Status In Customer Accounts

You've got a variable in there named '$display_tracking_status' in the HTML.  Is that being populated with anything?


Nick Hendler

Offline

 

#6 04-09-2004 09:17:19

48hourprint
Member
Registered: 02-03-2003
Posts: 22

Re: Order Status In Customer Accounts

No.... I changed it back to $tracking_status and it's now just showing the Tracking Letter mentiond above.

Offline

 

#7 04-17-2004 13:36:16

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19872
Website

Re: Order Status In Customer Accounts

Right below:

Code:


($tracking_id,$tracking_date,$tracking_status,$tracking_email,$tracking_total) = @$row;

You could add:

Code:


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...


Nick Hendler

Offline

 

#8 04-17-2004 15:06:12

48hourprint
Member
Registered: 02-03-2003
Posts: 22

Re: Order Status In Customer Accounts

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

 

Board footer