www.uburst.com www.uburst.com

"Order Numbers"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

Programmer Tips
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"Order Numbers"
Posted by Dave on Aug-29-00 at 03:34 PM (EST)
Can you setup ushop to give out a smaller order number, or better yet a date stamp instead of a random number?

ie
Aug. 12, 2000 09:19 32sec = 81200091232...

Or any thing like this!!

Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

RE: Order Numbers, Bill Weiner, Aug-30-00, (1)
ushop_authnet_30.pl, Sommay, Feb-15-01, (2)
RE: ushop_authnet_30.pl, Bill Weiner, Feb-15-01, (3)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: Order Numbers"
Posted by Bill Weiner on Aug-30-00 at 05:28 AM (EST)
Officially, "no" ... at this time, uShop always uses random numbers to determine the order number. But if you are not afraid to dabble in Perl, here are some instructions on where the order number is calculated and how to change the number to a time stamp.

1) Open the "ushop-lib.pl" file with any text editor such as Word Pad or Note Pad.

2) Do a search on "sub display_review_order_form" in order to locate the top of the display_review_order_form() subroutine.

3) About 13 lines into that subroutine, you will see where the order number and the order date are calculated:

# Create the order number.
srand(time|$$);
$random_number = int(rand(10000000));
$order_number = sprintf("%09d",$random_number);

# Get the order date.
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
if ($year > 99)
{
$year = $year - 100;
}
$order_date = sprintf("%02d/%02d/%02d",$mon+1,$mday,$year);

4) You can try re-setting the $order_number with a time stamp by adding the following line directly after the above section of code:

$order_number = sprintf("%02d%02d%02d%02d%02d%02d",$mon+1,$mday,$year,$hour,$min,$sec);

5) Save the ushop-lib.pl file (as TEXT if your editor asks).

6) Try it out!

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
2 . "ushop_authnet_30.pl"
Posted by Sommay on Feb-15-01 at 00:59 AM (EST)
How do I make these change for "ushop_authnet_30.pl"
Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
3 . "RE: ushop_authnet_30.pl"
Posted by Bill Weiner on Feb-15-01 at 06:16 AM (EST)
It is a little more difficult to make a similar change to the older version of uShop 2.x, but I believe this is how it can be done:

Suggestion: Make a backup of your current script first... just in case.

1) Open the "ushop_authnet_30.pl" file with any text editor such as Word Pad or Note Pad.

2) Do a search on the following line:

# Write the data to a file and email notification.

(there should be only one occurance of that line in the entire file)

3) Immediately after that line and BEFORE the line:

&write_data($uShop_filename, *form_text);

... add the following lines:

# Get the order date.
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
$year += 1900;
$mon += 1;
$uShop_filename = sprintf("U%02d%02d%02d%02d%02d%02d",$mon+1,$mday,$year,$hour,$min,$sec);

4) Do a search on the following line:

# Send all required params as hidden fields.

(there should be only one occurance of that line in the entire file)

5) Immediately after that line you will see a line ending with:

NAME=\"x_Invoice_Num\" VALUE=\"$FORM_DATA{'ord'}\">";

... change that to:

NAME=\"x_Invoice_Num\" VALUE=\"$uShop_filename\">";

6) Also, immediately BEFORE that line, add this line:

$uShop_filename =~ s/U//g;

7) Save the file (as TEXT if your editor asks).... and try it out.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.