♥akmac Posted November 9, 2005 Share Posted November 9, 2005 When you apply the coupon the first time, does it show this under the shopping cart info box? Coupon : more info No, nothing shows in the cart until after I enter the code a second time and click "redeem". Then it will show "Coupon :10% Off" in the cart box. Check my version of ot_coupon.php against yours, hopefully this will help you find your error. I used your file and still get the same issue. Only now, I get the message: "The coupon code has been successfully applied for <BR>***HOWEVER:No reducion available, please see the coupon restrictions***" (I also implemented your addition to the language file) There are no coupon restrictions: Coupon Name : 10% Off Coupon Amount : 10.0000% Start Date : 11/09/2005 End Date : 11/09/2006 Uses per Coupon : 100 Uses per Customer : 100 Valid Product List : NONE Valid Categories List : NONE Date Created : 11/09/2005 Date Modified : 11/09/2005 This is evidenced by the fact that when I proceed to the confirmation page, the 10% discount is applied. 1. I enter the coupon code and click "redeem". 2.I get the message ""The coupon code has been successfully applied for <BR>***HOWEVER:No reducion available, please see the coupon restrictions***" And the discount does not show in the cart (or on the confirmation page if I continue. 3. Enter the same code again and click "redeem". I get the same message as above, but this time the discount shows in the cart, and on the confirmation page. I should mention that it works fine for gift vouchers. 1. Enter GV code and click "redeem" 2. I get message "The coupon code has been successfully applied for $25.00" (or whatever amount) and it shows in my cart and confirmation page. I appreciate you guys helping out. So, we know that the error isn't with the module itself, because I'm using Simon's working file. We know that it is an issue that affects the coupons, but not the gift vouchers. Now, what the heck is it? Quote Quidquid latine dictum sit, profundum viditur. Link to comment Share on other sites More sharing options...
faris10 Posted November 9, 2005 Share Posted November 9, 2005 Same way you did when you setup oSC. If you had it set it up with your hosting then hopefully they will also provide access to your db from your control panel via something like phpmyadmin. Alternatively you can download dbtools, set that up and use it to ?import? the SQL file. HTH Si. scranmer , in my osC in the admin where I can import the datatbase. I can also import an sql file from my own computer . Is that what you mean ? Quote Link to comment Share on other sites More sharing options...
♥akmac Posted November 9, 2005 Share Posted November 9, 2005 (edited) scranmer , in my osC in the admin where I can import the datatbase. I can also import an sql file from my own computer . Is that what you mean ? No, not in the osc admin. In phpmyadmin. You'll need to contact your host if you don't know how to log in. Sometimes you go to www.yoursite.com/phpmyadmin/ and log in using your mysql username and password, sometimes you log in through your host's provided control panel-you'll need to contact them to find out. Simon, another wrinkle I noticed. I get the "The coupon code has been successfully applied for <BR>***HOWEVER:No reducion available, please see the coupon restrictions***" The first two times I enter the same code and click "redeem", but if I enter it a third time, it gives the proper "The coupon code has been successfully applied for $5.50 on orders greater than $1.00". So, nothing works the first time, the discount applies the second time-but says it doesn't, and the third time everything works. Perhaps I should add instructions: "Just keep entering the code and clicking the button until it works" :blink: :-" Edited November 9, 2005 by akmac Quote Quidquid latine dictum sit, profundum viditur. Link to comment Share on other sites More sharing options...
faris10 Posted November 9, 2005 Share Posted November 9, 2005 No, not in the osc admin. In phpmyadmin. You'll need to contact your host if you don't know how to log in. Sometimes you go to www.yoursite.com/phpmyadmin/ and log in using your mysql username and password, sometimes you log in through your host's provided control panel-you'll need to contact them to find out. Simon, another wrinkle I noticed. I get the "The coupon code has been successfully applied for <BR>***HOWEVER:No reducion available, please see the coupon restrictions***" The first two times I enter the same code and click "redeem", but if I enter it a third time, it gives the proper "The coupon code has been successfully applied for $5.50 on orders greater than $1.00". So, nothing works the first time, the discount applies the second time-but says it doesn't, and the third time everything works. Perhaps I should add instructions: "Just keep entering the code and clicking the button until it works" :blink: :-" Okay , I found the PHP admin where I need only to imoport the .SQL . is that all what I need to do ? Do I need to give the new table a special name ? Quote Link to comment Share on other sites More sharing options...
scranmer Posted November 9, 2005 Share Posted November 9, 2005 Okay , I found the PHP admin where I need only to imoport the .SQL . is that all what I need to do ? Do I need to give the new table a special name ? faris, You ensure phpmyadmin is pointing at your db, click on the SQL tab, look on the screen for the "Location of the text file: ", click on the browse button, locate the sql file and click GO. This will load the sql file into your db. Then you are done. HTH Si. Quote Link to comment Share on other sites More sharing options...
molafish Posted November 10, 2005 Share Posted November 10, 2005 (edited) The first two times I enter the same code and click "redeem", but if I enter it a third time, it gives the proper "The coupon code has been successfully applied for $5.50 on orders greater than $1.00". This is interesting. As Simon said, something is wrong with your install. I have the same sort order as you, and have no problems (except that the redeem message is cut off, just as you were witnessing the first time). Many other people are reporting your same issue. I have started with the 5.13 Full Package by Rigaden install, then selectively applied other updates after that. Which package did you install? And which updates did you apply? Maybe we can find out where the error is for everybody... Another thing: the $1.00 thing puzzles me Maybe this would prevent coupons from being applied for free items (as in use the coupon to get free shipping on a free item). If no order minimum is set, it should not impose a restriction of $1.00. Edited November 10, 2005 by molafish Quote Link to comment Share on other sites More sharing options...
janetgot Posted November 10, 2005 Share Posted November 10, 2005 No, not in the osc admin. In phpmyadmin. You'll need to contact your host if you don't know how to log in. Sometimes you go to www.yoursite.com/phpmyadmin/ and log in using your mysql username and password, sometimes you log in through your host's provided control panel-you'll need to contact them to find out. Simon, another wrinkle I noticed. I get the "The coupon code has been successfully applied for <BR>***HOWEVER:No reducion available, please see the coupon restrictions***" The first two times I enter the same code and click "redeem", but if I enter it a third time, it gives the proper "The coupon code has been successfully applied for $5.50 on orders greater than $1.00". So, nothing works the first time, the discount applies the second time-but says it doesn't, and the third time everything works. Perhaps I should add instructions: "Just keep entering the code and clicking the button until it works" :blink: :-" Check here... http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=727577 Did you try that? It fixed my problem. Quote Link to comment Share on other sites More sharing options...
chooch Posted November 10, 2005 Share Posted November 10, 2005 Oh no!! Fatal error: Cannot redeclare class ot_coupon in /home/girliewi/public_html/CATALOG/includes/modules/order_total/ot_coupon.php on line 0 when i get to the checkout_payment page, this comes up... line ZERO? thats '<?php' can anyone please help me get rid of this error. i have checked the payment page and the files that i can make sense of, but need help many thanks Quote Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back! Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you? There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere. CHOOCH Link to comment Share on other sites More sharing options...
gamefuse Posted November 10, 2005 Share Posted November 10, 2005 is there a module that allows customers to view there current gift voucher amount during the checkout phase or a section in the "my account". Also I cant get the email link to work when I send a gift voucher, I edited the file as per the mod from contribution but to no evail Quote Link to comment Share on other sites More sharing options...
scranmer Posted November 10, 2005 Share Posted November 10, 2005 Oh no!! Fatal error: Cannot redeclare class ot_coupon in /home/girliewi/public_html/CATALOG/includes/modules/order_total/ot_coupon.php on line 0 when i get to the checkout_payment page, this comes up... line ZERO? thats '<?php' can anyone please help me get rid of this error. i have checked the payment page and the files that i can make sense of, but need help many thanks Chooch, First php and linux are not as forgiving as windows and all pointers to files etc MUST be in the correct case so /home/girliewi/public_html/CATALOG/includes/modules/order_total/ot_coupon.php is not the same as /home/girliewi/public_html/catalog/includes/modules/order_total/ot_coupon.php So first check your setup does not have CATALOG in upper and then check that in dir /home/girliewi/public_html/catalog/includes/modules/order_total you have not created any copies of ot_coupon.php because these will be included into OSC. HTH Si. gamefuse, Once the GV has been redeemed by the admin or if a customer enters the gv code into checkout, the amount will appear in the shopping cart under the checkout totals. As per the email link it should definatly work so I suggest you recheck your coding. HTH Si. Quote Link to comment Share on other sites More sharing options...
gamefuse Posted November 10, 2005 Share Posted November 10, 2005 (edited) How do you reset the Gift Voucher's Sent list, as I have a few on there that were tests that I want to remove. Si in regards to yoour response, yes thats true it does redeem and show the voucher amount in the checkout, but what if Im not buying anything, how can i see how much I have left etc. Edited November 10, 2005 by gamefuse Quote Link to comment Share on other sites More sharing options...
scranmer Posted November 10, 2005 Share Posted November 10, 2005 How do you reset the Gift Voucher's Sent list, as I have a few on there that were tests that I want to remove.Si in regards to yoour response, yes thats true it does redeem and show the voucher amount in the checkout, but what if Im not buying anything, how can i see how much I have left etc. gamefuse, Look back a few pages I posted all the SQL needed for this and other things. Si. Quote Link to comment Share on other sites More sharing options...
gamefuse Posted November 10, 2005 Share Posted November 10, 2005 gamefuse, Look back a few pages I posted all the SQL needed for this and other things. Si. with the email I have done the following Very simple, backup, backup, back up! This replaces the non-clickable link in sent gift voucher/coupons to clickable. Much simpler for the receiver! In catalog/gv_send.php replace (around line 81) $gv_email .= EMAIL_GV_LINK . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $id1,'NONSSL',false);; with $gv_email .= EMAIL_GV_LINK . ' ' . "<a HREF='" . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $id1,'NONSSL',false) . "'>" . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $id1,'NONSSL',false) . "</a>\n" . but the email still turns out like this : this is a test The Gift Voucher is worth $5.00 To redeem this Gift Voucher, please click on the link below. Please also write down the redemption code which is cfdbb4 in case you have any problems. /gv_redeem.php?gv_no=cfdbb4 or visit / and enter the code during the checkout process no link and no web address, am I missing something in the code? Quote Link to comment Share on other sites More sharing options...
scranmer Posted November 10, 2005 Share Posted November 10, 2005 Gamefuse, Cant see anything wrong with this. I have not implimented this code as I have a clickable link from the original (maybe because Im using a recent version of outlook). Looking through the code it should work fine, the funtion tep_href_link (look in /includes/functions/html_output.php) will automaticaly put the rest of the link together on line 23, so I would sugest you just check your variables HTTP_SERVER DIR_WS_HTTP_CATALOG just before the call and in the function. If these are empty I dont know why because they should be automaticaly imported from your configure.php Si. Quote Link to comment Share on other sites More sharing options...
♥akmac Posted November 10, 2005 Share Posted November 10, 2005 Janetgot-Thanks! I don't know how I missed that! In any case, swithching the order of those two lines corrects the issue of having to enter the coupon code twice to get it to apply. Now, the only remaining issue that I have (and am aware of =-) is that the "error" message is still returning "The coupon code has been successfully applied for <BR>***HOWEVER:No reducion available, please see the coupon restrictions***". Then, if I enter it again and hit redeem, I get the correct "The coupon code has been successfully applied for $5.50" Sounds like some lines of code need to switch places somewhere.... It functions correctly, but not in the correct order. Quote Quidquid latine dictum sit, profundum viditur. Link to comment Share on other sites More sharing options...
♥akmac Posted November 10, 2005 Share Posted November 10, 2005 (edited) Now, the only remaining issue that I have (and am aware of =-) is that the "error" message is still returning "The coupon code has been successfully applied for <BR>***HOWEVER:No reducion available, please see the coupon restrictions***". Then, if I enter it again and hit redeem, I get the correct "The coupon code has been successfully applied for $5.50" Sounds like some lines of code need to switch places somewhere.... It functions correctly, but not in the correct order. Does anyone know which code will need to be moved so that the percentage off will apply after the first "redeem" click? It seems that the $coupon_amount_out is not being updated until AFTER the "error" text is returned... Edited November 10, 2005 by akmac Quote Quidquid latine dictum sit, profundum viditur. Link to comment Share on other sites More sharing options...
scranmer Posted November 10, 2005 Share Posted November 10, 2005 akmac, This message is generated in includes/modules/order_total/ot_coupon.php around line 130. Are you sure you order totals are in the correct possition? if so look at my contribution for this message, lines 145-150 show how to add vat on if the order module is positioned after this modules. HTH Si. Quote Link to comment Share on other sites More sharing options...
chooch Posted November 10, 2005 Share Posted November 10, 2005 Si. hi i have updated your ccgv add-on contribution and it works fines except his: The coupon has been successfully applied for <BR>***HOWEVER:No reducion available, please see the coupon restrictions*** it actually does say <br> and sucessfully applied for "_" doesn't show any advice please? Quote Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back! Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you? There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere. CHOOCH Link to comment Share on other sites More sharing options...
♥akmac Posted November 10, 2005 Share Posted November 10, 2005 (edited) akmac, This message is generated in includes/modules/order_total/ot_coupon.php around line 130. Are you sure you order totals are in the correct possition? if so look at my contribution for this message, lines 145-150 show how to add vat on if the order module is positioned after this modules. HTH Si. Hi Simon, I'm using your same ot_coupon.php. But, for whatever reason, the error message is output before the percentage off amount is calculated. If instead of: if ( strlen($cc_id)>0 && $coupon_amount==0 ) { $err_msg = ERROR_REDEEMED_AMOUNT.ERROR_REDEEMED_AMOUNT_ZERO; } else { $err_msg = ERROR_REDEEMED_AMOUNT.$coupon_amount_out; } I put: if ( strlen($cc_id)>0 && $coupon_amount==0 ) { $err_msg = ERROR_REDEEMED_AMOUNT.$coupon_amount_out; } else { $err_msg = ERROR_REDEEMED_AMOUNT.$coupon_amount_out; } Then I get: "The coupon code has been successfully applied for $0.00" the first time I redeem it and: "The coupon code has been successfully applied for $5.50" (correct amount of discount) the second time. Could it have something to do with commenting out: //// load the before_process function from the payment modules // $payment_modules->before_process(); in catalog/checkout_process.php? This had to be done so that the gift vouchers would function with only one payment method enabled. Possible workaround? Edited November 10, 2005 by akmac Quote Quidquid latine dictum sit, profundum viditur. Link to comment Share on other sites More sharing options...
scranmer Posted November 10, 2005 Share Posted November 10, 2005 akmac, yes it bl**dy wood. This is the process that calculates and sets the values. Why did you comment it out? I have only 1 payment process and it works fine. If you were getting messages from that payment modules saying that fields had to be filled you needed to surround those checks with something like... global $credit_covers; //check to see if gv installed if (isset($credit_covers)) { //check to see if credit balance>order total if ( $credit_covers ) { return true; } else { ....else do checks... } } Si. Quote Link to comment Share on other sites More sharing options...
♥akmac Posted November 10, 2005 Share Posted November 10, 2005 akmac, yes it bl**dy wood. This is the process that calculates and sets the values. Why did you comment it out? I have only 1 payment process and it works fine. If you were getting messages from that payment modules saying that fields had to be filled you needed to surround those checks with something like... Si. Well, I uncommented it and ran a few codes through. Identical problem persists.... Quote Quidquid latine dictum sit, profundum viditur. Link to comment Share on other sites More sharing options...
scranmer Posted November 10, 2005 Share Posted November 10, 2005 WHAT!?!? Is there anything else youve commented out / changed? What payment modules you using? Si. Quote Link to comment Share on other sites More sharing options...
♥akmac Posted November 10, 2005 Share Posted November 10, 2005 WHAT!?!? Is there anything else youve commented out / changed? What payment modules you using? Si. No, I just use trustcommerce (credit cards) I'm trying to remember what error that line caused when using only one payment method. In any case, it's unrelated to the problem of the error text loading before the discount ammount is calculated. The same problem is afflicting Ian as well... Anyone else noticing that their message that tells the customer how much their coupon saves them is cut off? In other words, it only says "The coupon code has been successfully applied for " ??? Quote Quidquid latine dictum sit, profundum viditur. Link to comment Share on other sites More sharing options...
♥akmac Posted November 10, 2005 Share Posted November 10, 2005 (edited) Simon, sorry, the code was still in my checkout_process.php-I had just moved it down 5-6 lines. require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; $order_totals = $order_total_modules->process(); // load the before_process function from the payment modules $payment_modules->before_process(); I had changed the order because the wrong amount was being sent to my CC processor. It wasn't deducting the discount from the total. Edited November 10, 2005 by akmac Quote Quidquid latine dictum sit, profundum viditur. Link to comment Share on other sites More sharing options...
scranmer Posted November 10, 2005 Share Posted November 10, 2005 Simon, sorry, the code was still in my checkout_process.php-I had just moved it down 5-6 lines. require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; $order_totals = $order_total_modules->process(); // load the before_process function from the payment modules $payment_modules->before_process(); I had changed the order because the wrong amount was being sent to my CC processor. It wasn't deducting the discount from the total. You could try to put some debugs in ot_coupon and find if the cc_id or which other fields it is thats is not set the first but then the second time, check the order total amount passed in is correct, then work back from there. Si. 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.