Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

CCGV(trad) Enter Voucher Code instead of automatic generation


resoman

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

Link to comment
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

Link to comment
Share on other sites

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...