-Spazmatic- Posted December 23, 2005 Share Posted December 23, 2005 Fatal error: Cannot redeclare create_coupon_code() (previously declared in /home/content/a/w/a/awardsfor/html/catalog/includes/functions/general.php:17) in /home/content/a/w/a/awardsfor/html/catalog/includes/add_ccgvdc_application_top.php on line 36 What do I do? Link to comment Share on other sites More sharing options...
kwalker Posted December 23, 2005 Share Posted December 23, 2005 Fatal error: Cannot redeclare create_coupon_code() (previously declared in /home/content/a/w/a/awardsfor/html/catalog/includes/functions/general.php:17) in /home/content/a/w/a/awardsfor/html/catalog/includes/add_ccgvdc_application_top.php on line 36 What do I do? If it's a contrib, go to their support thread. It should be in your docs, or do a search. Kevin "What I didn't know yesterday, I know today & will remember tomorrow" (By Kwalker) What do you see when you open up the tep_database-pr2.2-CVS.pdf file that came with your osCommerce download? Link to comment Share on other sites More sharing options...
-Spazmatic- Posted December 23, 2005 Author Share Posted December 23, 2005 Done a search, I'm looking in the thread now but with no results. Link to comment Share on other sites More sharing options...
♥toyicebear Posted December 23, 2005 Share Posted December 23, 2005 Fatal error: Cannot redeclare create_coupon_code() (previously declared in /home/content/a/w/a/awardsfor/html/catalog/includes/functions/general.php:17) in /home/content/a/w/a/awardsfor/html/catalog/includes/add_ccgvdc_application_top.php on line 36 What do I do? The error is because its declared both in includes/functions/general.php and in includes/add_ccgvdc_application_top.php You need to remove it one of the places Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here] Link to comment Share on other sites More sharing options...
-Spazmatic- Posted December 23, 2005 Author Share Posted December 23, 2005 Does it matter which one I remove this from: //// // Create a Coupon Code. length may be between 1 and 16 Characters // $salt needs some thought. 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; } //// // Update the Customers GV account function tep_gv_account_update($customer_id, $gv_id) { $customer_gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'"); $coupon_gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'"); $coupon_gv = tep_db_fetch_array($coupon_gv_query); if (tep_db_num_rows($customer_gv_query) > 0) { $customer_gv = tep_db_fetch_array($customer_gv_query); $new_gv_amount = $customer_gv['amount'] + $coupon_gv['coupon_amount']; // new code bugfix $gv_query = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_gv_amount . "' where customer_id = '" . $customer_id . "'"); // original code $gv_query = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_gv_amount . "'"); } else { $gv_query = tep_db_query("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . $customer_id . "', '" . $coupon_gv['coupon_amount'] . "')"); } } //// // Get tax rate from tax description function tep_get_tax_rate_from_desc($tax_desc) { $tax_query = tep_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_description = '" . $tax_desc . "'"); $tax = tep_db_fetch_array($tax_query); return $tax['tax_rate']; } Because I removed it from add_ccgvdc_application_top.php Link to comment Share on other sites More sharing options...
-Spazmatic- Posted December 23, 2005 Author Share Posted December 23, 2005 I think it works. I'm not sure which one I was supposed to delete it from though....I'm kind of scared, I guess I'll just do some test purchases. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.