X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Shorten length of Gift Certificate codes (https://forum.x-cart.com/showthread.php?t=16463)

gfiebich 09-08-2005 11:00 AM

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

Gios 11-03-2005 11:41 AM

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.


All times are GMT -8. The time now is 05:30 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.