OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: CCGV(trad) Enter Voucher Code instead of automatic generation
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Order Total Modules
resoman
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!
resoman
Basically, with CCGV(trad) the coupon code is automatically generated at line 42 in admin/gv_mail.php:

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


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

QUOTE
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!
eandafern
I am trying to accomplish the same thing- did you find a solution?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.