Jump to content
Sign in to follow this  
resoman

CCGV(trad) Enter Voucher Code instead of automatic generation

Recommended Posts

Manually enter a code rather than have the script generate the number for the voucher? My client has actual gift cards with numbers on the back he wants to use for the gift vouchers, this wont work with the current configuration of CCGV trad.

 

The system is great and does everything else though!

 

Thanks VGER!


Jesse Rooney

Share this post


Link to post
Share on other sites

Basically, with CCGV(trad) the coupon code is automatically generated at line 42 in admin/gv_mail.php:

 

	  $id1 = create_coupon_code($mail['customers_email_address']);

 

I found it calls to admin/includes/add_ccgvdc_application_top.php:

 

function create_coupon_code($salt="secret", $length=SECURITY_CODE_LENGTH) {

$ccid = md5(uniqid("","salt"));

$ccid .= md5(uniqid("","salt"));

$ccid .= md5(uniqid("","salt"));

$ccid .= md5(uniqid("","salt"));

srand((double)microtime()*1000000); // seed the random number generator

$random_start = @rand(0, (128-$length));

$good_result = 0;

while ($good_result == 0) {

$id1=substr($ccid, $random_start,$length);

$query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_code = '" . $id1 . "'");

if (tep_db_num_rows($query) == 0) $good_result = 1;

}

return $id1;

}

 

Is there a way to just use a text box and input the coupon code I want to use? I am by far no programmer, but this system is so simple to use thanks to all of the contributions and great support!

 

Thanks!


Jesse Rooney

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×