dawnblue Posted September 5, 2006 Share Posted September 5, 2006 You should find many posts on this topic. It has to do with permissions on your site: http://www.google.com/search?hl=en&q=I...G=Google+Search Very helpful Thanks!! I just set the permissions to 444 on that file and it fixed it. I appreciate all of your help - excellent mod. It did several things I was needing it to do Quote Link to comment Share on other sites More sharing options...
mike1985 Posted September 7, 2006 Share Posted September 7, 2006 after updating my discount coupon to the latest one with all the fixes i get an error in the discount coupon report, when i enter i get this message. everything else works fine, but the discount coupon report module. 1054 - Unknown column 'dc.number_available' in 'field list' select dc.coupons_id, dc.coupons_discount_percent, dc.number_available, COUNT(dcto.discount_coupons_to_orders_id) AS use_count from discount_coupons AS dc left join discount_coupons_to_orders AS dcto ON dc.coupons_id = dcto.coupons_id group by dc.coupons_id order by use_count desc, dc.coupons_id asc limit 0, 100 [TEP STOP] Quote Link to comment Share on other sites More sharing options...
kgt Posted September 7, 2006 Author Share Posted September 7, 2006 after updating my discount coupon to the latest one with all the fixes i get an error in the discount coupon report, when i enter i get this message. everything else works fine, but the discount coupon report module. 1054 - Unknown column 'dc.number_available' in 'field list' select dc.coupons_id, dc.coupons_discount_percent, dc.number_available, COUNT(dcto.discount_coupons_to_orders_id) AS use_count from discount_coupons AS dc left join discount_coupons_to_orders AS dcto ON dc.coupons_id = dcto.coupons_id group by dc.coupons_id order by use_count desc, dc.coupons_id asc limit 0, 100 [TEP STOP] The field names all got changed to discount_coupons_*. So just edit that file and make sure all field names have "discount_coupons_" as a prefix. Quote Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
mike1985 Posted September 7, 2006 Share Posted September 7, 2006 thank you for clearing it up, will do. Quote Link to comment Share on other sites More sharing options...
nfway Posted September 7, 2006 Share Posted September 7, 2006 Hello, I've followed all your instructions for installing both the 2.0 version as well as the "class fix" version. Everything seems to be working great other then when I try to submit a valid coupon to an order that has not met the min. order value. If I do this, I get sent to checkout_confirmation.php (normal) and the page is completely blank (no errors displayed, but obviously broken). It looks like something is breaking when the order tries to verify that min and max values are met. Can anyone offer a hand here, or maybe guide me as to where to begin looking? Thanks, N PS. If you would like to see what I am talking about, feel free to check out my site at http://pyp-bomb.com and click on the "ORDER" tab on the top right. Once in, you can try coupon code "XYZTEST" (min. is set to $25, no max, discount = .05) on a test order which should not meet the $25.00 min. value. Quote Link to comment Share on other sites More sharing options...
dropdeadred Posted September 7, 2006 Share Posted September 7, 2006 Just wanted to say I installed this contrib this morning and it works a treat - great job, and thanks! Quote Link to comment Share on other sites More sharing options...
jokatz Posted September 7, 2006 Share Posted September 7, 2006 (edited) Please help me.... :o Hi, this is my first post. I have already installed some other contributions and so far it was ok... I have a serious issue with this contribution...I installed it, and it looks to be working fine (not 100% as there are some minor issues that I'll report about it later). the thing is that now under my admin > modules > order total I'm getting this error message: Fatal error: Cannot redeclare class ot_discount_coupon in bla bla bla /catalog/includes/modules/order_total/ot_discount_coupon.php on line 15 Do you know what is wrong? Thank you very much for your help! Edited September 7, 2006 by jokatz Quote Link to comment Share on other sites More sharing options...
nfway Posted September 8, 2006 Share Posted September 8, 2006 Hello, I've followed all your instructions for installing both the 2.0 version as well as the "class fix" version. Everything seems to be working great other then when I try to submit a valid coupon to an order that has not met the min. order value. If I do this, I get sent to checkout_confirmation.php (normal) and the page is completely blank (no errors displayed, but obviously broken). It looks like something is breaking when the order tries to verify that min and max values are met. Can anyone offer a hand here, or maybe guide me as to where to begin looking? Well, I looked around a bit myself and came up with at least a temporary solution. The prob is in classes/discount_coupon,php. Specifically, it is in the function check_coupons_min_order(). The last line seems to be having a problem with the whole $currencies->format... statement. ORIGINAL: if( $this->coupon['coupons_min_order'] > $subtotal ) $this->error_message[] = sprintf( ENTRY_DISCOUNT_COUPON_MIN_ERROR, $currencies->format( $this->coupon['coupons_min_order'], true, $order->info['currency'], $order->info['currency_value'] ) ); NEW: if( $this->coupon['coupons_min_order'] > $subtotal ) $this->error_message[] = sprintf( ENTRY_DISCOUNT_COUPON_MIN_ERROR, (number_format($this->coupon['coupons_min_order'],2)), true, $order->info['currency'], $order->info['currency_value']); I needed to get these coupons working, so, while a more elegant solution is not available, this will due. If anyone has any suggestions as to how to actually fix the whole $currencies issue, please do let me know. Thanks, N Quote Link to comment Share on other sites More sharing options...
kgt Posted September 8, 2006 Author Share Posted September 8, 2006 Well, I looked around a bit myself and came up with at least a temporary solution. The prob is in classes/discount_coupon,php. Specifically, it is in the function check_coupons_min_order(). The last line seems to be having a problem with the whole $currencies->format... statement. ORIGINAL: if( $this->coupon['coupons_min_order'] > $subtotal ) $this->error_message[] = sprintf( ENTRY_DISCOUNT_COUPON_MIN_ERROR, $currencies->format( $this->coupon['coupons_min_order'], true, $order->info['currency'], $order->info['currency_value'] ) ); NEW: if( $this->coupon['coupons_min_order'] > $subtotal ) $this->error_message[] = sprintf( ENTRY_DISCOUNT_COUPON_MIN_ERROR, (number_format($this->coupon['coupons_min_order'],2)), true, $order->info['currency'], $order->info['currency_value']); I needed to get these coupons working, so, while a more elegant solution is not available, this will due. If anyone has any suggestions as to how to actually fix the whole $currencies issue, please do let me know. Thanks, N See this post: http://www.oscommerce.com/forums/index.php?sho...019&st=260# Quote Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
kgt Posted September 8, 2006 Author Share Posted September 8, 2006 Please help me.... :o Hi, this is my first post. I have already installed some other contributions and so far it was ok... I have a serious issue with this contribution...I installed it, and it looks to be working fine (not 100% as there are some minor issues that I'll report about it later). the thing is that now under my admin > modules > order total I'm getting this error message: Fatal error: Cannot redeclare class ot_discount_coupon in bla bla bla /catalog/includes/modules/order_total/ot_discount_coupon.php on line 15 Do you know what is wrong? Thank you very much for your help! The solution is outlined in the common problems text file in the zip download and in the manual. Open includes/classes/discount_coupon.php and comment out the require_once line. Quote Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
nfway Posted September 8, 2006 Share Posted September 8, 2006 See this post: http://www.oscommerce.com/forums/index.php?sho...019&st=260# kgt, Thanks or the response. I totally missed the declaration. Thank you for pointing it out. Worked like a charm. Excellent contribution btw!! Cheers, N Quote Link to comment Share on other sites More sharing options...
rabbit0860 Posted September 11, 2006 Share Posted September 11, 2006 I am first timer here , I just installed the discount coupon code, and the coupon input box showed up, but when I click on "continue", I got a error message popped up Fatal error: Cannot instantiate non-existent class: discount_coupon in /home/ing/public_html/catalog/checkout_confirmation.php on line 73 I upload all the files with FTP as directed, configure the module in admin panel, since I haven't used any other contributions yet. what can I do to get it straight?:( can anyone here lighten me up? Quote slingcarrier dot com Link to comment Share on other sites More sharing options...
1042 Posted September 11, 2006 Share Posted September 11, 2006 Hi All, very nice addon to os commerce, i install this and it's working fine, the only issue i have is that on the checkout_confirmation.php the discount takes place but nothing shows to let the customer know that he coupon was applied ( the line that reads "coupon number bla -$", any ideas if i missed something during the installation? Quote Link to comment Share on other sites More sharing options...
kgt Posted September 12, 2006 Author Share Posted September 12, 2006 Hi All, very nice addon to os commerce, i install this and it's working fine, the only issue i have is that on the checkout_confirmation.php the discount takes place but nothing shows to let the customer know that he coupon was applied ( the line that reads "coupon number bla -$", any ideas if i missed something during the installation? There is a manual available as a link in the upper right corner of the coupons admin page. It also has some common problems and solutions. I suspect this is a result of a non-unique sort order for the order total modules. Try going to Modules > Order Total, and make sure each module has a unique sort order. Quote Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
kgt Posted September 12, 2006 Author Share Posted September 12, 2006 I am first timer here , I just installed the discount coupon code, and the coupon input box showed up, but when I click on "continue", I got a error message popped upFatal error: Cannot instantiate non-existent class: discount_coupon in /home/ing/public_html/catalog/checkout_confirmation.php on line 73 I upload all the files with FTP as directed, configure the module in admin panel, since I haven't used any other contributions yet. what can I do to get it straight?:( can anyone here lighten me up? Try adding this line: require_once( DIR_WS_CLASSES . 'discount_coupon.php' ); after //kgt - discount coupons if( tep_not_null( $HTTP_POST_VARS['coupon'] ) ) { //if they have entered something in the coupon field on line 71 in checkout_confirmation.php. Quote Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
rabbit0860 Posted September 12, 2006 Share Posted September 12, 2006 (edited) Thanks!:DI reinstalled all the files one by one now it's working for the most part!!! one more problem with coupon, I set the coupon from database directly, 15% off, but no matter what the total order amount, it always takes $90 off, sometimes the total came out negative, what could be the reason of it? is there any parameter that I set wrong? Edited September 12, 2006 by rabbit0860 Quote slingcarrier dot com Link to comment Share on other sites More sharing options...
Guest Posted September 13, 2006 Share Posted September 13, 2006 If there is a value in the "Number Available" field, then that coupon code should only be able to be redeemed that number of times, correct? This doesn't seem to work, because I am able to use the same coupon code as many times as I want, even if I set that number to 1. I can't seem to find anything in the code that decrements that amount when a coupon is redeemed. Am I missing something? Quote Link to comment Share on other sites More sharing options...
kgt Posted September 13, 2006 Author Share Posted September 13, 2006 Thanks!:DI reinstalled all the files one by one now it's working for the most part!!! one more problem with coupon, I set the coupon from database directly, 15% off, but no matter what the total order amount, it always takes $90 off, sometimes the total came out negative, what could be the reason of it? is there any parameter that I set wrong? Percentages must be entered as .15 not 15. Quote Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
kgt Posted September 13, 2006 Author Share Posted September 13, 2006 If there is a value in the "Number Available" field, then that coupon code should only be able to be redeemed that number of times, correct? This doesn't seem to work, because I am able to use the same coupon code as many times as I want, even if I set that number to 1. I can't seem to find anything in the code that decrements that amount when a coupon is redeemed. Am I missing something? There's actually an increment, not the other way around. We track the coupons that have been used, so to check number_available, we need to count the number that have been used. This is stored in the discount_coupons_to_orders table. Make sure there are entries in there for the coupon you're using. If not, then that's where the problem is. Quote Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
Guest Posted September 13, 2006 Share Posted September 13, 2006 There's actually an increment, not the other way around. We track the coupons that have been used, so to check number_available, we need to count the number that have been used. This is stored in the discount_coupons_to_orders table. Make sure there are entries in there for the coupon you're using. If not, then that's where the problem is. Thanks for the fast reply. I discovered that was your methodology after I made my post. However, I also notice that the function check_num_available() is where that lookup takes place, and the only time that is called is in the verify_code() function. Unfortunately, I don't see any place where verify_code() is called, which probably explains why I'm able to use the same coupon more times than the number of available. I added the function call to the discount_coupon class get_coupon() function and it looks like everything gets checked now. function get_coupon() { $check_code_query = tep_db_query( $sql = "SELECT coupons_discount_percent, coupons_description, coupons_max_use, coupons_min_order, coupons_max_order, coupons_number_available FROM " . TABLE_DISCOUNT_COUPONS . " WHERE coupons_id = '" . tep_db_prepare_input( $this->code ) . "' AND ( coupons_date_start <= CURDATE() OR coupons_date_start IS NULL ) AND ( coupons_date_end >= CURDATE() OR coupons_date_end IS NULL )" ); if( tep_db_num_rows( $check_code_query ) != 1 ) { //if no rows are returned, then they haven't entered a valid code $this->error_message[] = ENTRY_DISCOUNT_COUPON_ERROR; //display the error message } else { $row = tep_db_fetch_array( $check_code_query ); //since there is one record, we have a valid code $this->coupon = $row; // ADD BY MJH 09/13/06 $this->verify_code(); if ($this->is_errors()) { $this->coupon = null; } // END ADD } } Quote Link to comment Share on other sites More sharing options...
kgt Posted September 13, 2006 Author Share Posted September 13, 2006 Thanks for the fast reply. I discovered that was your methodology after I made my post. However, I also notice that the function check_num_available() is where that lookup takes place, and the only time that is called is in the verify_code() function. Unfortunately, I don't see any place where verify_code() is called, which probably explains why I'm able to use the same coupon more times than the number of available. I added the function call to the discount_coupon class get_coupon() function and it looks like everything gets checked now. Yes, the most recent update fixes that: http://www.oscommerce.com/community/contributions,4269 You can add the code in checkout_confirmation or in the discount_coupon class as you did to fix it. Quote Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
Guest Posted September 13, 2006 Share Posted September 13, 2006 Yes, the most recent update fixes that: http://www.oscommerce.com/community/contributions,4269 You can add the code in checkout_confirmation or in the discount_coupon class as you did to fix it. Well, I guess that's what I get for checking the support thread before checking the contributions page itself. I must have downloaded v2.0 the day before the bugfix. Thanks for the help. Quote Link to comment Share on other sites More sharing options...
rabbit0860 Posted September 13, 2006 Share Posted September 13, 2006 Percentages must be entered as .15 not 15. 0.15 is what I entered, I don't understand why it's always -$90, no matter the subtotal is $29.95 or $125 or any other amount.. :'( someone give me a hint please Quote slingcarrier dot com Link to comment Share on other sites More sharing options...
Guest Posted September 14, 2006 Share Posted September 14, 2006 Firstly, this contribution is exactly what I was looking for and everything was so easy to set up - well done and thank you! Now, I need a little help - when completing checkout instead of seeing the checkout success page, I see this: Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in *******\includes\classes\email.php on line 520 Warning: Cannot modify header information - headers already sent by (output started at *******\includes\classes\email.php:520) in ******\includes\functions\general.php on line 33 I'm not sure where to start to fix this, my store is pretty well modified, I suspect the error is in general.php rather than email.php - but being a complete beginner I don't know where to start! Any suggestions would be really appreciated - let me know if I need to post the code for each or either file. Thanks! Nick Happy Horses Supplies Quote Link to comment Share on other sites More sharing options...
kgt Posted September 14, 2006 Author Share Posted September 14, 2006 0.15 is what I entered, I don't understand why it's always -$90, no matter the subtotal is $29.95 or $125 or any other amount.. :'( someone give me a hint please You're going to have to give more information, like the values of the other fields, a sample of your order confirmation totals (with the products prices and quantities included). It's just not possible to make a wild guess as to what the problem is. Quote Contributions Discount Coupon Codes Donations 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.