www.uburst.com www.uburst.com

"order number"

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

General Questions
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"order number"
Posted by M Ulm on Sep-05-02 at 12:35 PM (EST)
I would like to shorten the date part of the order number to just ddmmy with the y being the last digit of the year. I would also like to remove the "-" from the middle.
Thanks
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 number, Bill Weiner, Sep-06-02, (1)
RE: order number, Joe Banks, Dec-23-02, (2)
RE: order number, Bill Weiner, Dec-24-02, (3)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: order number"
Posted by Bill Weiner on Sep-06-02 at 04:01 AM (EST)
To change the format of the date used for the order number to the format that you describe, here are some steps to customize the uShop CGI script:

STEP 1: Make a backup of your current ushop-lib.pl script... just in case.

STEP 2: Open your ushop-lib.pl script with any text editor such as WordPad.

STEP 3: Do a search on the following line:

if ($order_number_format == 0)

STEP 4: Change that section of code from:

if ($order_number_format == 0)
{
$order_number = sprintf("%09d",$random_number);
}
elsif ($order_number_format == 1)
{
$order_number = sprintf("%02d%02d%04d-%09d",$mon,$mday,$year,$random_number);
}
else
{
$order_number = sprintf("%02d%02d%04d-%09d",$mday,$mon,$year,$random_number);
}

To:

$year = $year - 2000;
if ($order_number_format == 0)
{
$order_number = sprintf("%09d",$random_number);
}
elsif ($order_number_format == 1)
{
$order_number = sprintf("%02d%02d%d%09d",$mon,$mday,$year,$random_number);
}
else
{
$order_number = sprintf("%02d%02d%d%09d",$mday,$mon,$year,$random_number);
}

(You basically add the "$year = $year - 2000;" line and change two "sprintf" lines.)

STEP 5: Save the script... 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
 
2 . "RE: order number"
Posted by Joe Banks on Dec-23-02 at 11:04 PM (EST)

> (You basically add the "$year = $year - 2000;" line and change two "sprintf" lines.)

HMM- IS THIS Y3K COMPLIANT?

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: order number"
Posted by Bill Weiner on Dec-24-02 at 06:31 AM (EST)
Given that this is only to achieve the format that he wants for the order number (ddmmy), it's not critical. But he can deal with that when Y3K comes around :^)
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.