Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Shorten length of Gift Certificate codes

 
Closed Thread
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 09-08-2005, 11:00 AM
 
gfiebich gfiebich is offline
 

Senior Member
  
Join Date: Feb 2003
Location: St. Paul, MN
Posts: 108
 

Default Shorten length of Gift Certificate codes

My client wasn't happy with the length of the auto-generated gift certificate codes (16 characters long). Here's the tweak I made to cause the system to generate shorter codes:

In /admin/giftcerts.php look for

Code:
$gcid = strtoupper(md5(uniqid(rand())));

and change this to

Code:
$gcid = substr(strtoupper(md5(uniqid(rand()))),0,6);

This simply trims the original gcid down to the last 6 characters. It should be noted that this statistically reduces the uniqueness of the the Gift Certificate code.

This was done in x-cart gold 4.0.13
__________________
NO LONGER USING X-CART - NOT ACTIVE IN THESE FORUMS
  #2  
Old 11-03-2005, 11:41 AM
 
Gios Gios is offline
 

Newbie
  
Join Date: Sep 2005
Posts: 6
 

Default

That works great, thanks. But it only works if you enter a GC in the admin area. If a customer buys a GC it is still the long code...hmmm

I tried looking at /giftcert.php, not /admin/giftcerts.php but nothing with MD5 there.

hmmm, wonder how to fix this?

Thanks again.
__________________
4.0.16
Closed Thread
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:02 PM.

   

 
X-Cart forums © 2001-2020