Jon Burdon Posted July 22, 2009 Share Posted July 22, 2009 I just installed addon GV and DC RC1 RC2 RC2a v1.2 in to my demo shop. I logged in with a dummy account and tried to buy an item. I got this error at checkout: "Fatal error: Call to undefined function tep_count_active_coupons() in /home/fhlinux133/p/planetprimary.co.uk/user/htdocs/catalog/checkout_payment.php on line 318" I have no payment method set up yet. Any ideas? Quote Link to comment Share on other sites More sharing options...
germ Posted July 22, 2009 Share Posted July 22, 2009 function tep_count_active_coupons() { $coupon_query = tep_db_query("select count(*) as total from " . TABLE_COUPONS . " where coupon_status = '1'"); $coupons = tep_db_fetch_array($coupon_query); return $coupons['total']; } Add to /catalog/includes/functions/general.php at the bottom BEFORE the closing PHP tag: ?> It was probably in the install directions somewhere... :huh: Backup the file before editing. You break it - You bought it. :o Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
Jon Burdon Posted July 22, 2009 Author Share Posted July 22, 2009 Brill. That seems to have fixed that..... and thrown up a new error when I checkout.... "1146 - Table 'planetprim1.TABLE_COUPONS' doesn't exist select count(*) as total from TABLE_COUPONS where coupon_status = '1' [TEP STOP]" Quote Link to comment Share on other sites More sharing options...
Jon Burdon Posted July 22, 2009 Author Share Posted July 22, 2009 I found an SQL file that I have not installed. It looks like this: CREATE TABLE coupon_to_customer ( coupon_id int(11) NOT NULL default '0', customer_id int(11) NOT NULL default '0', order_id int(11) NOT NULL default '0', redeem_date datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (coupon_id,customer_id,order_id) ) TYPE=MyISAM; CREATE TABLE coupons ( coupon_id int(11) NOT NULL auto_increment, coupon_code varchar(32) NOT NULL default '', coupon_amount decimal(15,4) NOT NULL default '0.0000', coupon_type tinyint(1) NOT NULL default '0', coupon_status tinyint(1) NOT NULL default '0', coupon_use tinyint(1) NOT NULL default '0', PRIMARY KEY (coupon_id) ) TYPE=MyISAM; Is that what is causing the problem? The installation instructions don't seem to say what I need to do with it. Quote Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted July 22, 2009 Share Posted July 22, 2009 (edited) Probably assumed you would know :-) See my useful threads link for a guide on "running" sql commands/code. Enjoy G Edited July 22, 2009 by geoffreywalton Quote Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>. Link to comment Share on other sites More sharing options...
Jon Burdon Posted July 22, 2009 Author Share Posted July 22, 2009 Probably assumed you would know :-) See my useful threads link for a guide on "running" sql commands/code. Enjoy G Where can I find these? I have done a few searched which reveal nothing. Sorry to ask again. Quote Link to comment Share on other sites More sharing options...
Jon Burdon Posted July 22, 2009 Author Share Posted July 22, 2009 I have now run the sql code successfully on my phpmyadmin tool. Never done that before! I still have this checkout error: " 1146 - Table 'planetprim1.TABLE_COUPONS' doesn't exist select count(*) as total from TABLE_COUPONS where coupon_status = '1' [TEP STOP]" Quote Link to comment Share on other sites More sharing options...
nealc Posted July 22, 2009 Share Posted July 22, 2009 I have now run the sql code successfully on my phpmyadmin tool. Never done that before! I still have this checkout error: " 1146 - Table 'planetprim1.TABLE_COUPONS' doesn't exist select count(*) as total from TABLE_COUPONS where coupon_status = '1' [TEP STOP]" Did you double check that you created the table coupons? Quote I am currently just learning osCommerce and PHP, but am always willing to help out. Have successfully installed the following: Discount Coupons, UPS shipping module, Ultimate SEO URL's, Easy Meta Tags for SEO 1.0, Google XML Sitemap SEO v1.3, HTML Editor for Email and Newsletters. Link to comment Share on other sites More sharing options...
germ Posted July 22, 2009 Share Posted July 22, 2009 Either you can't follow directions very well, or the contrib has some crappy instructions... :huh: My guess is you were supposed ot add something to /catalog/includes/database_tables.php like: define('TABLE_COUPONS', '[size=5][color="#FF0000"][b]?????????????????????[/b][/color][/size]'); Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
Jon Burdon Posted July 22, 2009 Author Share Posted July 22, 2009 I mucked around again with re-uploading stuff file by file and checking stuff carefully. I tried following all the advice above.... and hey presto something I did made it work!!! Thanks. Sometimes instructions are just far too brief for us first timers. Quote Link to comment Share on other sites More sharing options...
Jon Burdon Posted July 22, 2009 Author Share Posted July 22, 2009 Now that the code doesn't throw back an error, I have set up a coupon in my admin tool. Then as a user I get to the Payment Information page and I just see TABLE_HEADING_COUPON and TEXT_COUPON_ENTERED instead of a discount being applied. Any thoughts? 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.