resoman Posted November 6, 2007 Share Posted November 6, 2007 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! Quote Jesse Rooney Link to comment Share on other sites More sharing options...
resoman Posted November 6, 2007 Author Share Posted November 6, 2007 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! Quote Jesse Rooney Link to comment Share on other sites More sharing options...
eandafern Posted April 11, 2008 Share Posted April 11, 2008 I am trying to accomplish the same thing- did you find a solution? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.