uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Products
       uTest
       uReserve
       uShop
       uStorekeeper
       uGolf
       uDirectory
       uSignIn
 Tech Support
       Support Policy
       Knowledge Base
            uTest
            uReserve
            uShop
            uStorekeeper
            uGolf
            uDirectory
            uSignIn
       Documentation
       Reference Sites
 Legal
       Software Piracy
       Legal Notices
       Privacy Policy
       Licensing
 Miscellaneous
       Reseller Info
       Contact Us
       Site Map
Order Numbers

Knowledge Base Lobby : uShop Support Conference : Programmer Tips
Nov-18-17 02:15 PM EST
Original Message
Order Numbers
Author Dave on 08-29-2000 at 15:34 (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!!
E-MAIL AUTHOR | TABLE OF CONTENTS

Table Of Contents
  RE: Order Numbers Bill Weiner, 2000-08-30 05:28:05 (1)
            ushop_authnet_30.pl Sommay, 2001-02-15 00:59:10 (2)
                 RE: ushop_authnet_30.pl Bill Weiner, 2001-02-15 06:16:54 (3)

Messages In This Discussion
         1. RE: Order Numbers
        Author Bill Weiner on 08-30-2000 at 05:28 (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&pip;$$);
$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!



TABLE OF CONTENTS
                 2. ushop_authnet_30.pl
                Author Sommay on 02-15-2001 at 00:59 (EST)
How do I make these change for "ushop_authnet_30.pl"
TABLE OF CONTENTS
                         3. RE: ushop_authnet_30.pl
                        Author Bill Weiner on 02-15-2001 at 06:16 (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.
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.