STOP PRESS: This contribution is now updated to Version 5 and has all sorts of cool extras. Please see the latest post about this.
–
Offering Gift Vouchers/Discounts is an excellent way to make sales, particularly on products where margins are high. A good example of this is “digital products” where (more than likely) margin is probably 100% of the sale amount.
By offering a 50% or more Discount Coupon, vendor is still making a good amount and the buyer has a bargain.
new client required the ability to offer Gift Vouchers and Discounts on the latest version of osCommerce which is called “RC1”. After having a hunt through the Contributions area yesterday, I could not find anything that was suitable in terms of;
- usable on RC1
- easy to use for “not web savvy” person
- coded cleanly
So, I went back to the drawing board and coded my own – based on some work I did years ago. With just a few lines of code I’ve now got a really nice Gift Vouchers package suitable for the latest version of osCommerce.
It’s usable with RC1 and RC2 – I do have a MS2 version somewhere also. Anyone who wants it, please comment below and I will make time to turn it into a freely available contribution.
Added Screenshot showing Sort Orders (that work for me):
Oh, when/if you comment, please let me know whether you require RC1 or RC2 or MS2 version. Thanks.
hi!!! thats exactly what i’m after!! your a legend!!! if at all possible i’d love this contribution… its exactly what i need π GREAT JOB !!!!
thanks again
misery_kitty
oops forgot to mention i need the ms2 π
Sure, I’ll try and find time to get it found.
If you upgrade to RC2a, you can have it immediately π
can i do that with a templated version?? as i tell you what i’d love to do it right away lol π
I tried ur script. Unfortunately… it doesnt display the coupon code details and also doesnot apply the discount to the total on the confirm_payment page… ??? can u plz tell me what is wrong…
this looks really neat, my brain nearly exploded with the other complex ones
Jenson – if it does not work, then most likely you have installed it incorrectly. Maybe missed adding some code, or did not set up the order_total correctly in your Admin section? Start Over π
Sasha – thanks π
I have checked it with ms2, and I am sad to say that it is not working. First of all the discount does not show on the confirmation page. I noticed that even in the video this is the case, only after you click on payment method and confirm it again the coupon shows. Well this was not the case with my ms2 version, it did not show at all. Furthermore I tried to place another order right after I used the coupon for the first one. And for some strange reason I wasnt able to fill in a coupon number due to the fact that it said I already used one for that order. While in fact I did not use one for that order but the previous one.
It’s not for MS2 π
Good spot onthe “not showing discount in confirmation” though – I had missed that π
All you need to do is remove the block of code from lines 85 to 106 inclusive of checkout_confirmation.php and move it to ABOVE the line of code that is;
require(DIR_WS_CLASSES . ‘order_total.php’);
Doh! No point calling the discount after the order_total. Good spot, thanks.
And I also forgot a whole file – which is the cause of the other error. I’ll get a new package uploaded tonight sometime π
Even though it might not be for MS2 I still noticed the fact that in the video the discount did not show the first time you showed the confirmation page. Is it some kind of bug in the system or intentionally put there?
Bert – yes, I forgot a file and made a mistake in 1 other file. I’ll repackage the fixes and upload. I might even port to MS2 at the same time.
Pingback: Club osCommerce » Version 1.1 of Discount Coupons and Gift Vouchers for RC osCommerce
Now fixed both errors – please download at http://addons.oscommerce.com/info/5743
Any and all support/discussion is welcome on this blog post.
Hi!
I’m interested in this. There are two other contributions with similar names, CCGV(trad) and Credit Class & Gift Voucher, which alters the Osc core files quite extensively, which is not good, how about this one? Is this new contibution of yours, built on these or is it a new approach to achieve the same thing? Would you mind elaborate a bit…
You don’t happen to know whether it will play nicely together with Separate Pricing Per Customer 4.2.0 (SPPC)?
KBK – this is a brand new approach to get (almost) the same thing. As far as I know, my version is simpler than the others that you mention. Mine does not alter much of the core code of osCommerce – only: checkout_process.php, checkout_confirmation.php and checkout_payment.php …
What mine does not have is a system to email customers a voucher/discount code. For me, that is pointless so I did not code it.
I don’t know if it will play nicely with SPPC – perhaps, you would post again here, if you do try it?
Oh, it also has a couple new functions – but nothing major.
Also, I’m on ms2.2 on which I’ve applied the patches for RC1 and planning to apply the RC2 as well. Will this be enough to use your contribution?
TIA
/kbking
KBK – should be fine. Just take it slowly and use the “already installed” folder rather than the “install on new”. The “install on new” is a bunch of drop in files for someowho has just installed RC. You won’t want that as you already have some contributions installed – and dropping in a new file might hurt those already installed contributions.
In the “already installed” folder, you’ll see a bunch of folder and files. Any files ending in .php are OK to just upload as they won’t overwrite anything. Any files ending in .txt will need the code contained in them to be added to your pre-existing .php files of the same name. It makes sense when you see it π
It might be worth you installing a clean RC2 as a test site, then installing the drop-in files so that you can test the contribution to see if it’s suitable for what you need.
Good luck!
Thanks for now π
Hey,
Thanks for this code, very simple to put in a very very modified osc. I have QTPRO installed and no problem with it (impossible with others big voucher’s contribs).
Just one thing for others, you have to sort order “coupon” to “0” in order total module to see reduction in action. (one hour to understand:-( ).
Gilles, many thanks for your feedback, I really appreciate it π
I’m not sure about teh sort_order having to be zero – might that be somehting that’s in your shop only? I really don’t know…I added a screenshot to the original post (up there^) that shows sort orders that work nicely…at least for me!
I’ll await more feedback on it, and see if anyone else has the same as you – and put it into the readme if needed.
Thanks!
Gary
bonjour,
yeah!
My error after different tests was to order coupon after taxe. Before taxe, there is no pb.
—-
Sous-Total: 16.90 β¬
Colissimo direct suivi (2 kg): 7.00 β¬
Coupon (5%surmacommande) -0.85 β¬
TOTAL TVA: 2.77 β¬
Total: 23.05 β¬
——
I have tranlate it for a french shop. Do you want code?
Merci, Thanks
Wow this is an excellent contribution. Thanks for sharing and I will use it in my shop;-)
LΓΒ©onie.
Gilles – I would very much like your french translation – thank you. I will add it into the download on the oscommerce site. My email address is oscshops AT gmail DOT com – merci!.
LΓΒ©onie – thank you very much for your feedback. Nice t-shirt site you have there.
I Send you a .rar with french translation and screenshot of the result
I would like this contribution for osCommerce 2.2-MS2?
me again π
just thought i’d pop in and ask how the ms2 golden ticket is coming lol… cheers mate!! π
Gilles – thank you very much!
Mike & MK – I’ll get around to it, need to find some free time π
On the Delivery Page, when I click on Continue, I get this error on the next page:
1146 – Table ‘western_oscommerce.TABLE_COUPONS’ doesn’t exist
select count(*) as total from TABLE_COUPONS where coupon_status = ‘1’
[TEP STOP]
I have this display order:
1 – Sub Total
2 – Coupon
3 – Shipping
4 – Total
The table coupons and coupon_to_customer exist. The coupons table also has the
information in it.
Thanks for your help.
Hi,
I recently installed this add-on which I can’t wait to use as I think it is great!
However when on my oscommerce, at the top of every page I recieve this error…
Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /includes/database_tables.php:133)
AND… I can’t acces my admin control at all I just recieve this…
Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /admin/includes/filenames.php:70)
WHAT CAN I DO???
Thanks for all help in advance…
Joey
From the Delivery Information page, when I select Continue, I get the following error:
1146 – Table ‘western_oscommerce.TABLE_COUPONS’ doesn’t exist
select count(*) as total from TABLE_COUPONS where coupon_status = ‘1’
[TEP STOP]
The table coupons does exist.
Any help would be greatly appreciated.
I love this.
Seeing such a thing is one the moments when I wish I had become a programmer…
itΓΒ΄s exactly what I was looking for.
Cheers
Well I would need the version for RC1…
thanks
Craig – you need to make sure that you have added the name of the database table to the file admin/includes/database_tables.php
Joey – you have made a common mistake. Make sure that you have no blank lines or spaces after the final ?> or before the first <? of includes/database_tables.php and admin/includes/filenames.php
Joachim – so go download it and install it π
It is in the first line I believe:
<?php
define{‘TABLE_COUPONS’, ‘coupons’};
/*
$Id: $
If that’s the first line of your file, it won’t work. Should be
define(‘TABLE_COUPONS’, ‘coupons’);
— remove the curly brackets.
My mistake, the first line is as you said it should be, they are ( ), not { }. But still have the error.
Just wanted to let you know that I got it working. I uninstalled and started fresh. I guess I missed somethiong before.
Now that it is working, it was worth it. It is working great! Thanks.
I was wondering if the wording “Discount Coupon” on the Payment Information page can be
changed to “Member Discount”.
Thanks.
Craig – good work π You can change the wording in the language files -> /includes/languages/checkout_payment.php
Unfortunately after getting rid of all spaces between these files I am still getting the following errors at the top of every page on oscommere:
Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at x/catalog/includes/database_tables.php:58) in x/catalog/includes/functions/sessions.php on line 102
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at x/catalog/includes/database_tables.php:58) in x/catalog/includes/functions/sessions.php on line 102
AND, in the admin panel, which is still in-accessable…
Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at x/admin/includes/database_tables.php:49) in x/admin/includes/functions/sessions.php on line 102
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at x/admin/includes/database_tables.php:49) in x/admin/includes/functions/sessions.php on line 102
Warning: Cannot modify header information – headers already sent by (output started at x/admin/includes/database_tables.php:49) in x/admin/includes/functions/general.php on line 40
Can anyone help…
Thanks a lot again!!
Joey
Fixed the problem now but when I log into my admin control I get the following error now…
Should I just do the same and delete all spaces??
Yes I’ve fixed that one now but now have :
Parse error: syntax error, unexpected ‘}’ in /admin/includes/boxes/customers.php on line 43
On my Admin control and it all looks a bit out of place?
Sorry for all the questions but i’m really in a hurry to sort this out, thanks again!
Sorry guys its ok, I fixed it myself, I think that I put it in the wrong place to start with, but for some it may be best if you word where about to put it because that section got a bit confusing. May have just been me though!
Great add-on!!!
Thanks again!
Joey
Glad you got it sorted π
I thought I had it all done, but while testing, it seems that it is not changing any price. In the invoice or anyhting.
Any reasons why this is?
User Error when installing, most likely π
Make sure that you have set up your order_totals correctly.
Sounds like you need 1-on-1 assistance π
Sorry my error sorted yet agin, I should look before posting here in future. π
Anyway as I said before a great, easy to use add-on you have here, keep up the good work!!
Hi
I have installed this add-on to my oscommerce version 2.2RC2. After much testing, i have found that when a coupon is created and given to a customer to use, they can repeatedly use the coupon over & over, even when the coupon has been deleted, set to ‘once’ or turned-off! After the customer has entered the coupon code, they can make repeated orders with the same coupons discount. At the ‘checkout_payment’ page, it reads ‘A coupon has already been applied to this order’. At the ‘checkout_confirmation’ page, the discount is applied, even if the coupon has already been used, set to once, switched-off or deleted! Has anyone else experienced this same problem? Please help as to how to fix this.
Thanks, Brad
Joey – good work, glad you got there in the end.
Brad – I just tested this and cannot duplicate your findings. I tried this on RC2 (a brnad new install) with my GV/dc contrib applied on top.
Can you send me your store URL and a coupon code – to my email address: oscshops AT gmail DOT com
Thanks.
is this working for non RC1 version?the earlier one?
At this moment, it’s for RC1, RC2, RC2a only.
Im afriad my site is not currently live. I have checked the install over 3 times and everythhing is exactly as it should be. Do you need to have any php functions activated?
Nope, should work right out the box if everything is installed (and configured) correctly.
Can’t help any more without trying it live on your server.
I think i found the problem…i have been testing the add-on by confirming the order with PayPal IPN, and obviously not actually paying. Therefore the order never fully completes so the add-on thinks that the order is still on-going; hence why the coupon discount always stayed! I assumed as the order was placed as it showed in the back-admin. Does this make sense to you? Is the code set up to dispose of the coupon after the checkout_success page has been displayed?
Thanks, Brad
Brad – good thinking. The coupon is destroyed when the buyer hits “checkout_process.php” – obviously depending upon whether the coupon is a “once” or a “multiple” will determine whether they can use it again. Try setting up “cash on delivery” and see if you can recreate the error using that particular payment method.
Success – testing with ‘cash on delivery’ now fully works. But do you know if the customer is returned to checkout_success after they have paid with PayPal IPN? Im not sure as i have never paid for something on my own site!
WOW you are a busy boy admin!! lol… osc help/contributions are sniffed out and swarmed these days lol π that is all ….thought i’d comment on the great work you’re …always nice to hear i feel π
Brad – yes, the main order processing page is checkout_process.php and (as far as I am aware) ALL orders are passed through it at some stage.
MK – thanks π
Pingback: Club osCommerce » Version 1.2 of Discount Coupons and Gift Vouchers for RC osCommerce
TAXPROBLEM!
Great mod but i have a tax-problem:
1 – Sub Total: 200 Euro
2 – Coupon: -20 Euro
3 – Shipping: 0.00 Euro (Free)
4 – Tax 19%: 38.00 Euro
5 – Total: 218 Euro
It has to be:
1 – Sub Total: 200 Euro
2 – Coupon: -20 Euro
3 – Shipping: 0.00 Euro (Free)
4 – Tax 19%: 34.20 Euro
5 – Total: 214.20 Euro
How to fix? Thanks!
Hi, I’m just wondering if the coupon ties to a particular customer ID, or it can be used by any customer? Is it possible to make the coupon options can be set to:
(1) be used by one or all customers;
(2) restricted on some items or no item restrictions;
(3) requires minimum order total or no minimum;
(4) has expiration or no expiration.
If your contrib can do those, it will be great. Thanks.
Mike; my understanding is that a GV must be applied at the end price (otherwise you will be showing tax problems). Thus:
Product: 200
Tax @ 19%: 38
Discount (10%): 20
Total to Pay: 218
Maybe in the next update I will look at the codebase for applying on the product price, after which discount is then worked out and tax applied.
Taf; no such limits like that. Any customer can use the coupon on any product.
Hey, yes itΓΒ΄s me again…
Ehm I was just wondering, and
think it would be a good idea
to make it visible in the
administration-area if a coupon
has been used or even ensure,
that it would “turn off” itselvesΓΒ΄
state of activity because that would be so handy to keep order…
Ok just an idea…
Hi,
This contribution looks great. Just want I am looking for. I was wondering if you have the MS2 (for osCommerce 2.2-MS2) version ready yet.
thanks
girl
Joachim – that’s a good idea – but whether you select “once” or multiple”, the coupon never runs out. Once is once per customer, not just once in total.
It would be quite easy to make a new page showing the uses of the coupons. Maybe in the next update.
Girl – MS2 version is not yet started.
This looks like a great contribution. Thank you!
Unfortunately, I am having some difficulty with it: I’ve tried it on a v2.2RC2a local store I’m working on. I never see the coupon amount deducted from the total but the next time I do a purchase it tells me that the coupon has been used. I’m looking at your screenshot and I do not have ‘Coupon’ listed as an item in my Order Total. What did I miss?
Thanks much!
Francisco; make sure that you have uploaded the file;
/includes/modules/order_total/ot_coupon.php
Hi,
I’ve installed the contrib, and have it showing on the checkout_shipping.php page. Its using FEC with AJAX total update. However is not picking up the couplon discount. Any help would be greatly appreciated.
Thanks
Alan
FEC (Fast Easy Checkout for those no in the know ;)) is a contribution that makes the checkout process a bit less long.
Alan – FEC makes too many changes to the core code – in other words, it’s poorly coded in relation to the osCommerce Code standards. What version of osCommerce are you using?
I’m using R2 I think. Can’t see where to says it. Is it possable you could sort it out. Can you email me to discuss?
Hey ,
this looks great but is it available for MS2
Paul
Thanks Gary! Uploading /includes/modules/order_total/ot_coupon.php did the trick!
I have an additional question: any thoughts on how I can complete the transaction while skipping going to PayPal IPN if the total amount (after the coupon) equals zero?
Much appreciated!!
Paul; RC1, RC2, RC2a at this moment. I might try to get around to making a MS2 version sooner rather than later.
Francisco; I think this is not possible – have you had a hunt in the osCommerce Forum? Try “bypass paypal if payment amount zero” (or something like that).
I was afraid of that Gary. Yes, I have searched quite a bit in the forums but will do more. Thanks for your prompt reply!
A quick hunt in Google brought me this link: http://www.activeebiz.com/bypass-payment-page-p-29.html
But it does cost money, and I have no idea if it’ll work in your situation.
Hmmmn. Thinking about it…
The Coupon shows in the payment page – so you’d have to move that to a different page. Easy enough π
Then if the cart total is zero, skip the payment page.
Then if the cart total is zero, don’t show the payment info on the checkout_confirmation page
Then if the cart total is zero, make the button on checkout_confirmation go directly to checkout_process.php
It’s quite a lot of work, but I think it is do-able.
Thanks for the good input Gary! I did find a “Free Of Charge Payment Module” contribution that would work great but it does it’s check before one has the chance to apply the coupon. So if the amount is zero to begin with, the Free of Charge option shows up at payment time. I’m going through the code to see if I can identify where to change the order that the module kicks in. Any words of wisdom would be appreciated. Thanks much!
Francisco – if I can find a bit of time over the next few days, I’ll see if I can’t come up with something. It’d make an interesting project!
That would be outstanding Gary!!
Hey,
Thanks , or is it better to upgrade to RC 2.
Is that hard to do.
Paul
Paul – that depends upon how many contributions you have installed. If you have not done much with your Ms2, you would probably find it fairly easy to upgrade to RC2a.
Or you can wait and I might find time to make a MS2 version.
I just installed the coupon contribution. Everything seems to be working fine until i get to the checkout_confirmation.php page. It is not displaying the coupon or the discount? I went through the entire process again and double checked all of the code with the “install on brand new osc” code. Everything is identical. Does anyone have any ideas or suggestions?
Hey whats up?
my wife and i have installed your contribution, and been trying to work it in for the past 3 days, everything seem ok, just the last page order confirmation doesnt apply the coupon amount or show it, tried reviewing the code many times, and still nothing.
could it be that since we have the seperate canadian tax line contribution installed its not working? but the amount should still apply right?
I just realized what i did wrong. I needed to specify the sort order in the “orders total” within the admin section.
Everything is working great now!
Mike – good work.
Kevin – have a look at Mikes last post.
On the Payment Information page, when an invalid coupon code is entered, at the top it
says “You have entered an invalid coupon”. Can this wording be changed? (I would like it
to say “You have entered an invalid Member number”.)
Craig – you know those “language” files that are a part of the contribution… π
Yes, I’ve looked at various ones, but I cannot find the line to change.
Found it, thanks.
Craig – good work. I knew you’d find it if given a prompt.
sorry, this comes up
1054 – Unknown column ‘p.products_subimage1’ in ‘field list’
select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from products p, products_description pd where p.products_status = ‘1’ and p.products_id = ’28’ and pd.products_id = p.products_id and pd.language_id = ‘1’
what can I do to get it to work?
Hello Michelle – this error has nothing to do with the DC GV Contribution.
Has your friend tried to install some type of “extra images” contribution?
Before he installed it, we have had morepics 6 running with OSC 2.2 – can that be the problem and how do I solve it?
Get your friend to re-install π
Thanks for taking time to make a MS 2.2 version,
Is it also possible to add a percentage discount coupon instead of an amount coupon?
So a total of 10% etc. discount on the total of the next order amount.
Cheers,
Paul
Paul – you can do % or fixed already.
okay , great,
Paul
Burt.. looking forward to the MS 2.2 version π
Many thanks to you..
Text automatically translated from Italian
I have installed your contribution … Excellent work compliments!
One problem with taxes
Application by:
Sub-Total: Γ’βΒ¬ 30.00 EUR
Coupon (provabis) – Γ’βΒ¬ 3.00 EUR
PaccoCelere3 (price): Γ’βΒ¬ 9.10 EUR
Taxes 20% VAT: Γ’βΒ¬ 6.00 EUR
Total: Γ’βΒ¬ 42.10 EUR
The fee should be:
Sub-Total: Γ’βΒ¬ 30.00 EUR
Coupon (provabis) – Γ’βΒ¬ 3.00 EUR
$ 27.00
Taxes 20% VAT: Γ’βΒ¬ 5.40EUR
How can I fix?
There is the possibility to exclude a category from discount coupons?
Thanks for all the replies
Sub-Totale: Γ’βΒ¬ 30.00 EUR
Coupon (provabis) -Γ’βΒ¬ 3.00 EUR
27.00 EUR
Tasse IVA 20%: Γ’βΒ¬ 5.40EUR
Come posso risolvere?
Esiste la possibilitΓΒ di escludere una categoria dal discount coupon?
Grazie per le eventuali risposte
Alexander – soon π
Valdez – this has already been covered, read the comments π “There is the possibility to exclude a category from discount coupons?” – no.
Text automatically translated from Italian
Admin Thanks for the answer.
I saw earlier remarks and I revived the question why
Legigislazione the Italian plans to pay taxes in this way
Sub-Total: Γ’βΒ¬ 30.00
Coupon (provabis) – Γ’βΒ¬ 3.00
Γ’βΒ¬ 27.00
Taxes 20% VAT: Γ’βΒ¬ 5.40
Total Γ’βΒ¬ 32.40
Is there a solution?
Valdez – “Is there a solution?” – not yet π
Hi there,
having a problem, in the admin section it is showing as ” . BOX_TOOLS_COUPONS . ” .
Obviously that link isnt working, but when i copy the hyper, this is what is copying – tep_href_link(FILENAME_COUPONS)
any ideas?
many thanks π
Sunny – looks like you didn’t realise that the code needs to go INSIDE the brackets of the $contents[] array…it’s probably not too clear in the instructions.
Just upload the file admin/includes/boxes/customers.php to overwrite what you already have.
thanks Admin, but still got a problem.
There is no ‘Coupon’ option in the admin section
Sunny – you have not followed the full instructions and so now you have some problems. Start again.
yeah im gonna have to, thanks for the help!
ive got one more issue with my oscommerce, not a problem but something i need help on, is it ok if i email u?
Sure – nut please note that I answer on the blog, not by email. Like this; http://www.clubosc.com/paypal-payment-but-no-order.html
How is the Ms2 version coming?
hi again monkey with a cocktail lol… will you announce when you get the MS2 version going? I hate sounding like a sook π
.. just thought i’d ask so i dont have to keep asking lol.. saves you some sanity π
i tell you what you have some fans going now… you need to hire lil monkeys with lil red hats to get back to everyone lol π
Soon, soon π
Hi
It only took me 13 mins to get it installed and working all ok.
try it!!!!
Simon – well done.
I am using PayPal IPN, but the discount is not being passed to paypal. Discount appears on the confirmation page.
Ed – does it work with other payment methods? And which version of IPN are you using?
Hi,
Having tried many credit/voucher contribs over the years, this one finally seems like the right one. But with a heavily modded MS2 codebase (no file left untouched) I’m dreading upgrading the entire shop.
I’m happy to port this back to MS2 but would just like to know a summary of where you expect this code to clash with MS2. I have never looked at RC code so have no clue how different it may be.
PS Used to live in Surbiton too π
Hi Johan – I suspect that the code clash will be in the admin section only. I’m trying to find time to port it back, but it’s difficult as “real clients” have to come first – you know how it is!
Cheers, Gary
I have just installed DC GV on MS2-060817 and it installed without any problems! I’m surprised at that.
I followed the instructions in the “shop already installed” folder very carefully – and it all appears to work as it should do!
Great, will give that a go then, cheers!
Johan – please do let us know how the install went…
hiya again π so you telling us if we follow the directions under shop already installed properly we can use this mod on ms2?? ooow excited… cant wait as this is the last mod i want to install so i can go live… ooowww!!
Well…it worked for me without any problem, using version 1.2 of the download (the latest one). Let us know how you get on.
Hi,
trying to install on a MS2, and get this error when clicking on ‘Coupons’ in admin.
1054 – Unknown column ‘coupon_status’ in ‘field list’
select coupon_id, coupon_code, coupon_status, coupon_type, coupon_amount, coupon_use from coupons limit 0, 20
Any idea ?
regards
jarzom
Hahahaha, installed the table in wrong data-base.
Sorry !
hahahaha
Jarzom – doh! π
Thanks for this contribution. It was pretty easy to install, and works great. Unfortunately, I’ve just realized that I apparently can’t use it with Paypal express checkout because it ends at checkout_payment.php, before the coupon is applied.
Do you know if there’s a way I can get it to work? Or can I just not use express checkout?
Thank you
Would it be possible to enter the coupon code at checkout_shipping.php instead?
Heather – probably a fair bit of work for you to move the code to another page, but I see no reason why it would not work if you got it all correct…
I have a question about the checkout_payment.php file. Where do I insert the code that was provided by this mod. It doesn’t say exactly where to add this code. I must be missing something. Any help appreciated…..
David – anywhere you like in that file so long as it’s in the “body” section π Have a look at the supplied checkout_payment.php file to see where I put it…
Cheers, Gary
hmmm, I was hoping you might have an “easier” answer…I don’t know php enough to mess with it much. Thank you, though.
Hi,
I just finished installing your coupon module and LOVE it. It took about a day to install. Mainly because of an unfinished/failed attempt to install another “Discount Coupon Module”.
I am using v2.2 RC1 with UPS Shipping Module installed. I had an issue with sending the discount over to the PayPal_IPN module but found if you set the Transaction Type to “AGGREGATE” it works fine.
Isaac – thank you very much for your feedback – and thank you for the tip on setting Paypal to Aggregate π
Hi,
I was just seeing if there is a known I could try in order to get “Coupons” to show up in my OsCommerce v2.2 RC2 admin section please.
Thanks,
Ron
Isaac,
how did you adjust the paypal to aggregate? through their site or in Garys’ Voucher code??
thanks,
ron
Hi Gary,
this is Ron again. I compared files for customer.php in the two folders you have for “new install” and “old install” and found the problem. Thanks again.
I still would like a better understanding of how to change transaction for Paypal to an Aggregate please.
Ron
Ron – good work on comparing those files – it’s the easiest way to see any problems…
The Paypal aggregate setting, is I think, in the Paypal Module itself. If you go your Admin, then to your Paypal payment module and edit it, you should find a selection of r “aggregate”.
Cheers, Gary
Hi folks,
my english is not as well as i needed it for understanding this whole site, so please sorry if i’ve misunderstood something.
I want to install your conrib into an existing MS2.2 shop and it would be very helpful to know, if your version is working there or if (and when π you’ll make a special contrib for 22.
This contrib is looking very nice and there are a lot of other voucher- contribs full of bad code…
Thanks
Tom
Tom – your english is much better than my german π
This should be OK for MS2 – I have tested it personally in MS2-060817 and it worked fine.
Heather – there is an easier way – you can pay me to do it π
Unfortunately what you want is a fair bit of work and these free contributions are really a “one size fits all” deal.
If that size doesn’t fit you, then you need a bit of bespoke tailoring…hope that makes sense? Gary
Hi again,
i tried out some configs in between and now its working very fine. My problem wasnt in a code, i just did not set the sort order of the module to 0 like gilles found out.
When you install it in the admin area, its in the order 1 by default and then it does not show the amount in the checkout area.
Its working with MS22 if – like you said – you use the “shop already installed” version of the setup wich is no problem and done very fast at all.
You’ve done a great work with this, perhaps you could write this sort problem into the readme.txt and then its perfect for MS22 users to.
Best Regards
Tom
Hi,
I installed the contribution on my ocs just now. I am having only one difficulty as I am not to sure how to use the SQL file.
I am getting this error
1146 – Table ‘eoinhea_ladylike.coupons’ doesn’t exist
select count(*) as total from coupons
Any advice on how I run the file, Step by step would be great! π
Thanks you in advance,
Eoin
Eoin – no problem – see http://www.clubosc.com/how-to-use-phpmyadmin-to-load-sql.html
Tom – thanks for the feedback π
That seems to have done the trick.
I now have a different problem:
I can enter a coupon code in the checkout but it is not deducting the value from the order.
Any ideas?
Sorry to bother you again,
but just noticed that the Coupon option is not there.
Maybe this has something to do with the problem?
π
Eoin – you have not followed the instructions 100%. Start over.
It’s ok, I fixed it.
When uploading ot_coupon.php there must have been an interuption somewhere.
I noticed the file size was very small so i uploaded it again and it works just fine now.
Thanks for your time anyway, much appreciated π
Eoin
Cool! π
Cheers on an amazing contribution. I am really impressed with how you built your code on the OS Commerce core and simplicity. In contrast to some similar modules, you only two tables — fantastic. Works great — loaded on my website with some modifications. I think the other modules attempt to get too fancy rather than making sure the basics work. Thanks again.
Avi – thank you for your feedback. Very appreciated π
Hi there your Gift Vouchers RC1 and RC2 module very good. However there is one thing that i am facing which is when a customer of mine did a purchase a copy of the purchase was not notify or send to his mailing address.However i do receive the notification or email that he has make a purchase in my web mail.
Before i install this Gift Vouchers i do not face this problem i suspect that i could type wrongly in some of the files.
Could you kindly help me by advising where the problem will lies. Could it be the files checkout_confirmation.php.
I am really can you help! Thanks!
Teo – there’s only a few files you’d need to check. The best idea is for you to go over them again, making sure to make any code changes as carefully as possible.
Good luck – Gary
Hi, where can I download ? Thanks . . .!
AdriΓΒ‘n – http://addons.oscommerce.com/info/5743
Great add on. Had some issues but like you said just keep trying. Read this blog
and found all the answers I needed. Wanted to make a comment that my coupon works
when customer clicks Paypal and checks out (Using Paypal Express Payments and OSC rc2a)
though so don’t know if that will help Heather.(Also, I only tested in sandbox, haven’t
gone live yet!)
Kudos to you! Thanks a for a great site too btw! Learned a lot from you and I
didn’t know anything before I started a week ago.
Amy – thank you so much for your feedback π
Hi Gary,
I’m using PayPal IPN v2.3.3 with a RC2a store. I’ve read and re-read the posts and tweaked my settings accordingly but I can not get the discounted amount to go to PayPal. Each time the total (without the coupon discount) goes over. I wonder if there is code that should go on the paypal_ipn.php file.
Thanks!
BTW, I do have the transaction type set as “Aggregate” for PayPal. Also I have the Order Total set: Sub-total (1), Coupon (2), Shipping(3),Tax(4) and Total(5). Anything obvious I’m missing?
Hi Francisco – the problem is that the Paypal IPN 2.3.3 that you are using is a poorly coded piece of crap that doesn’t stick to osCommerce coding rules! I will try to find time to correct the code errors in the 2.3.3 code.
You could take a look yourself – the problem is with the way that the “amount” (to pay) is worked out (2.3.3 version is working it out completely incorrectly!)…
Cheers, Gary
I’m sorry to hear this Gary. Do you have any advice for me? Is there an IPN version you think is better?
Thanks!
Francisco – have a try with this module, which is a direct replacement for what you are already using, in /includes/modules/
Zip link
I make no guarantees that this will work, but it certainly looks better than the coding mistakes that are already in there! Test it out 100% to your satisfaction before using it in a live shop!
Thanks Gary! I’ll give it a go and will let you know what I find out.
Francisco
Interim testing update:
(1)paypal_ipn.php [v2.3.3] passes total amount (w/o deducting coupon) to paypal
(2)paypal_ipn.php [Gary’s replacement] takes the coupon amount from the total but adds shipping twice before sending to paypal.
Thoughts?
Francisco – in my version, try changing all instances of;
$order->info[‘total’]
to
$order->info[‘total’] – $order->info[‘shipping_cost’]
This seemed to do the trick Gary. Outstanding!! Thank you so much!!!!
Francisco – thanks π I updated the .zip with that change. If anyone else downloads it, I would highly suggest to fully test it out before using it in a Live Shop!
Hi Gary,
what a great contribution, it seems to be a very easy solution!
I only have 1 Question: How do I make sure the Voucher gets deducted from the total? All else seems to work fine, but the amount does not get deducted. The rest (amount of vouchers/creating voucher/etc) works.
My osc isr 2.2 RC1.
I would really appreciate your help, Gary.
Thank you in advance!
Frank
Frank – you need to specify the sort order in the “orders total” within the admin section. See the image at the bottom of the original blog post (up there ^)…Gary
I’ve a problem: discount isn’t removed from order total… checkout confirmation says:
Discount coupon (abcefg): -0.00 … but i set it to be fixed amount 10 Swiss francs.
I use fast Easy Checkout, and I applied all checkout_payment modifications to checkout_shipping.php … I use osc MS2060817
Luca – “I use fast Easy Checkout”
There’s your problem – FEC makes too many changes to the core code of osCommerce. However, I suspect that parts of the coupon functionality can be recoded to deal with the FEC codebase. But that’s something that will certianly not come cheaply – if you are interested please get in touch.
Gary
Just need a hint where to look … get this when the browser goes to checkout_process.php. It is identical to the new version in your files.
1366 – Incorrect decimal value: ” for column ‘value’ at row 1
insert into orders_total (orders_id, title, text, value, class, sort_order) values (‘4’, ‘Coupon (uflorida)’, ‘-$1.50’, ”, ‘ot_coupon’, ‘3’)
[TEP STOP]
Craig – for some reason your codebase is not transferring the correct “value”. Could be for any number of reasons, hard to say without seeing your live codebase – for which I would charge appropriately (in other words, don’t post a load of code here as that’ll do no good) – it needs further in depth investigation. I’d just start afresh if I were you.
Harmonie – it works with MS2 – just make sure to follow the installation instructions closely, and if you run into trouble refer to the “install on brand new” instructions to see wht you have done wrong.
Thanks Amy
Maybe we’re not using the same payment module? I’m using the “PayPal Website Payments Pro U.S.” mod which includes Express that comes with OSC. There is no way for the coupon to be applied as the page where the code is entered is as far as one can go when checking out with Express, thus the coupon doesn’t get entered…..
Maybe I just need to choose another Paypal mod? It’s confusing, as there are 3 that come with OSC, and tons more on the mod site. Why are there so many, anyway? sigh….
hey,
I spent over 3 hours with ‘another’ voucher contribution before finding out it doesn’t work with v2.2 RC2a.
Yours took 15 mins to install and after I remembered to set the coupon sort order to 0 it worked a treat.
Thanks loads.
Need some confirmation here.. I am using :
osCommerce 2.2 – MS2, PHP 5.0.4, MySQL 5.0.15-nt
Is it ok? already installed at test site. However, get this in Admin –> Coupons:
1064 – You have an error in your SQL syntax;
select count(*) as total from coupons limit -20, 20;
These coupon should apply to certain product or ..?
Can u help me? TQ.
Pleased Boy – many thanks for the feedback π The whole point of what I am trying to do with osCommerce these days is to make everything as simple as possible. I think that a lot of coders “overcook” things…
Mama – http://forums.oscommerce.com/index.php?showtopic=144095
after i install it, the admin workds, when i place the order works, the when i checkout, the discount is not applied, dont know why that happend, can someone help me?
Regards
Kenod Rosario – you have not followed the instructions 100%. Most likely you have not set the coupon sort order in your admin area. If you have, then just start over, and if that does not work, see this post.
hi Gary,
thanx for the good work, respect! i have a question: i need a german language file, do you have one? or do you know where can i get one?
Thanx and greetings from berlin-germany
Hey Eso – to fix this up, take the whole /includes/languages/english/ folder of the contribution and rename the folder to “german”. Upload! Then do the same for the Admin section…
Then you’ll have a lot of english words witin your german section, so you’ll need to translate them and change the appropriate english words to german words.
It’s not difficult – just takes a bit of time. If you do translate the files, please send them to me at shop AT oscbooks DOT com and I will add them to the contribution. Thanks.
If you cannot manage to get it working with German, I can help, please see here – I would have to use Babelfish to make the translations though.
Gary
Hey Gary,
it’s a wonderfull idea, thanx. why i get not self to this way? i dont know… :-). Of course, when i take the time and will be finished with the german translation i will send it to you! thats the way how it works with free contribs i think!
greets E
Hello Gary,
its me again. the german language problem i have done, an in the moment it looks good. but i have a generaly problem with the video.
by the start of the video you klicked in the admin site of the left menue on the 4th link from top, it calld by me “customers”. Then the 3rd link of this category is in the video “Coupons”. By me the last link is “orders”. Do you understand me, there is no link “coupons” the create one…
have you got a idea why?
thanks…
Eso – it’s because you haven’t followed the instructions π
Take a look at the code for the “install on brand new” folder – particularly the files; admin / includes / boxes/ customers.php – and compare it to what you have live in your server…you might see a difference..
well, looks like i dont found in the .txt where say that i need to change order of coupons :S
reading this post i found the answer π
Thanks the contrib works OK.
Hey RK – no worries – now you got it sorted π
For anyone else in the future having trouble seeing the instructions, it’s in the “Usage” section of the readme.txt
Hi Gary,
Thanks for the contribution. For the online shop, yes it works. Great!!
However for the admin site, actually I’ve done those modification before, but it didn’t work for me. Never mind, for the time being, I can manually alter the database.
TQ so much for your work!!
I have to say that this is one of the better thought out Contributions that I have worked with.
I like the approach to minimizing the impact to existing code and only ran into the trouble with the sort order until I came over here.
Very well done and thank you. I love the simplicity in the design.
Mama – you should be able to fix that problem up easily – make some more investigations in the forum about it and you might find the answer. If youy wanted me to fix it I can, but I would charge you to do so.
Jerry V – thanks π
hey man… m working on a site for a computer shop… my oscommerce version is v2.2rc2a…
i used ur latest solution for vouchers coupons…. but the problem is that i am not getting any error now… but when i finally checkout to process the order it refreshes to the first page again… and nth else happens… can u tell me y???
i m using paypal direct and express payments… its urgent and necessary…
waiting for reply… if u can mail me the solution thats will be more fine…
Assad – start again, or see here for installation service.
Works a treat, great work. I went down the shop already install route for this install, the only small problem was putting the code in the right place in catalog/checkout_payment.php as i found out it needed to go under
at about line 317
if the code is put anywhere else on this page the coupon shows up at the bottom of the payment page and not the middle.
Other than that this is a great mod. Thankyou for your time and effort.
Thanks TechHead π
Awesome job! It would be good that when the coupon is applied to the order, the shopping cart total is automatically recalculated and displayed. From your demo, it looks like the client has to double-check that the gift cert was applied and for what amount.
Felisa – the coupon is applied and is seen on the “confirmation screen”…the demo is a bit outdated π
Hi Gary,
It’s me again. Just to say that everything work for me. Just now I am on my way to modify it little bit so that it will meet my requirement.
Is it possible that only selected item get the discount, and also the discount is apply to all quantity for item A.
Example: Only item A get 20% discount, and if the customer buy 3 item A, each item A he will get 20% discount.
Any suggestion where should I start? Thanks..
Mama – what you need is quite complicated. It’s certainly possible.
My thought would be to have all the “allowed” products in an array – then check the customer cart to see if any of the products in his cart are also in the array. If yes, place the discount against the products that are in both.
See what you can come up with. I can take a look at coding something for you, but it’ll be expensive…
Is it possible to make coupons only re-deamable on orders over a set minimum order value?
Look forward to any replys
DR – yes it is, but not as part of the base code of the contribution. You’d just need to amend the checkout_payment.php page to only show the coupon input if the cart_total > X … It’s not a lot of work. Good luck!
If you want me to quote you for this, email me on oscshops@gmail.com
Gary
Hi, just downloaded the coupon voucher. One question though.
IN the Catalog/checkout_payment txt file you have the following code, but it doesnt tell me where in the checkout_payment.php it needs to go? Can you help? thanks Joe
Joe – compare that file to the file that is inside the “install on brand new” – π
If you have troubles, I have an installation service.
Cheers, Gary
Gary,
Thanks for the post for help. One question more. We got v2.2RC1. Will your contrib work with it? Cause the Voucher/Coupon selection isnt coming up. If it does Ill have to reinstall it to make sure I got all the changes made.
Thanks
Joe
Joe – it does work with RC1.
Nice contribution. Wish I could use it. After installing and realizing I’m not using RC1 nor RC2 I spent the next day and a half upgrading my site only to find out that this contribution does not work with a previos contribution I installed, namely Fast Easy Checkout (http://www.oscommerce.com/community/contributions,3469).
Can anyone help me and tell me how I can get these two excellent contribution to work with each other.
Thanks
Steve
Steve – FEC makes too many changes to the core code of osCommerce. However, I suspect that parts of the coupon functionality can be recoded to deal with the FEC codebase. But that’s something that will certainly not come cheaply – if you are interested please get in touch. Gary
Hi Gary
Installed this on RC2a under wamp. Works and easy
install.
Wondering if you plan to generate the coupon
code automatically in the future.
Also, any advice about using the GV part of the addon?
Coopco – the GV part is more than likely to be a paid upgrade (when I get around to coding it). Automatic coupon codes would be part of that.
Gary,
V2.2 rc2. installed your formula in a new OS then I get this
error
Fatal error: Cannot redeclare class soapclient in /home/saspreci/public_html/Amadeo/includes/classes/nusoap.php on line 7239
Any rescuing Idea,
Deo
Deo – nusoap class is not a standard part of osCommerce and is definitely not in my contribution. Start over?
I am interested in this,
not sure which version of OsCommerce I am using.
I think its an older version around 2005.
Can you please send it to me
Shane – you can download it and install yourself or you can pay to have it installed. Enjoy!
Gary,
I start over and all works great.
If I Create a GIft Certificate for $ 25 as one of my item
and assign coupon code to it. How can I avoid shipping charges
to it.
e.g. customer can buy $ 50.00 gift certificate and I will
e-mail them the discount code but there should be NO shipping
Charges to it.
Thanks
Deo
Hi,
Is there a specific place to insert the code under catalog/checkout_payment? (This is from the already installed shop text file).
Thanks.
Deo – give your product a zero weight, which should then bypass the shipping.
Camille – compare it against the file that is in the “install on new” folder.
Hi Gary, the contrib sounds great and I’d like to install a copy on my MS2.2 site. From reading your postings it appears that you now have a version that will work on MS2.2, so is there a place where I could download it from? It looks like on the site http://addons.oscommerce.com/info/5743 that this one isn’t the correct one for MS2.2
Hope you can assist.
Regards Rob.
Rob – it should install fine on MS2. Just follow the instructions closely and if you run into troubles, see here.
I have installed the complete package and all is good except when I get to the order confirmation page it has not applied the coupon. I set one up that can only be used once and that all works. once you have completed an order with that coupon it will not allow you to use the coupon again. I just cant get it to discount the price.
Thanks for the contrib!
K
Kev – make sure that you have the “sort order” correct in your admin area.
Gary,
2 things(re: no shipping).
1) my shipping is according to the $amount.
2) How can I prevent discount to my Gift Certificate.
Thanks
Deo
You cannot prevent that as the discount is based on the order total. Of course, it can be added to a future release, or you can have a go at coding it up yourself.
In the future, I intend to upgrade this contribution with all sorts of useful stuff such as;
– start date for voucher
– end date for voucher
– exclude products (or include products) from being discounted
– ability to purchase a Gift Voucher, and have it automatically create a PDF for the buyer to print off and give as a gift to someone else.
But all of these are sometime in the future.
Gary
oops, should realised that wouldn’t post right, I’m sure you know what I mean.:)
Chris – read further up the comments – this has been covered at least 3 times…
I have fixed that by moving it to the line above, the error has gone at least.
I have a new problem with the coupon not showing at all in the payment pages. I have checked all through the above and it seems that the most likely culprit is the sort order, I have tried it on zero and as you have it in the screen shot without effect. I am assuming seeing as no further errors are showing that everything is in place as it should be.
Any ideas?
Chris – yes – sort order. It cannot be the same as any toher as far as I am aware.
I have changed around the sort orders and it still isn’t showing, could it be anything else?. The admin side works exactly as it should be and the coupons are showing in phpmyadmin.
Chris – it’s hard to say – maybe an incompatibility with some other contribution, or with a different setting in your Admin area. Or, something else entirely. I presume you followed the install instructions exactly – if so, it should just work on a “normal” osCommerce…
Thanks Gary, I have added a few contributions but nothing too complex, define mainpage, a thumbnailer, server timezone fix, cross sell and quantity drop down.
I was a little unsure once or twice where to add the code additions but checked with the new install files and followed them without any trouble finding the relevant info. I will have start checking them all again.
Odd that one side should show ok and the other (catalog) does not show at all.
Problems with taxes,
I have tried to move the order total module to place 4. but still the price is wrong.
This script does not subtract the coupon before adding tax.
I have read through this post, some other people have also noticed this. Is there any solution? Could it be possible to add Tax Class to the coupon module?
Erik – certainly possible – it’s why the source is open code π
It’s something I intend looking at sometime in the future – paying projects come first (unfortunately).
What if I pay you to fix this for us? This is very important for us that this is ok.
Erik – that’s a nice offer thank you – I don’t (at the moment) have the time for such a large amendment of the codebase – you are most welcome to post up on one of the “free lance” sites to see if someone can update the codebase to deal with Tax – then maybe you would contribute the changes?
Alternatively, you can try my buddy Brian in the osC Forum – he is a great coder and might be able to help sooner than I can..
I can’t believe it happened again.. Nice and simple looking coupon solution wich has not been finished again.
Why are there so many contribs without correct tax calculation out there?
Every voucher/coupon/discount contrib without working tax calculation is useless..
Thanks for nothing.. Sorry but its just frustrating to install it just to find out about the tax issue again..
Stephan
“Thanks for nothing”
You are VERY welcome. The source is open, go ahead and make it work. You got what you paid for. Be thankful for that.
I apreciate your work, but you realy should not post it to the contributions area in that state or just mention that this contrib does not re-calculate any taxes and will always take the order total or something. I know that this is free etc pp
Just see it from my point of view. I have changed the code of my shop for it just to see that it does not work. So i can now just accept that my php code stays that way with useless code or reverse all changes.. or make a shedule for every day to look back here to hopefully find the changed and working script some day.
If i could do it, i would fix it my self.
Have a nice weekend!
Stephan – you have no idea what “Open Source” means. If you got your wish that no-one contributed anything unless it was perfect, then osCommerce would not even exist. Before you post again, THINK about what you are going to say.
i know that open source scripts (as most commercial products) are never realy finished and 100% bugfree and that every user is seen as a developer. everyone can improve the script, fix bugs, help out with documentation etc.
I was just wondering why the tax calculation has been left out again and was upset about it as it seems most coupon/voucher script coders forget about it.
I’m out.
Stephan
Hi, I purchased a oscommerce template that came already with the gift/coupon voucher module installed, I am able to create/email or even give new members gift cards after sign up, but I can not figure out how to sell gift cards via my catalog can anyone point me into the right direction?
thanks chad
Stephan – you’re out. Not much more I can say.
Chad – I think that the template would not include my DCGV contribution as standard – but it might do. You need to contact the template provider and ask exactly what Voucher contribution is installed – once you know this, you’ll be able to get more help.
All – this modification now works with Tax – see this blog post. This is only available via me installing for you.
i would like this feature on my website but i am using version ms2. can you send me the files to update please.
Manny – you can go ahead and download the files at the osCommerce downloads section, or to get the new updated version that includes tax calculations see here. The latest version is available at this moment only as an installable (by me) service.
Well guess what – i installed this on (a heavily modded) MS2.2 and it works just fine! did you update it for that already? i was really expecting to do some down and dirty code editing but no. above gilles (feb 17) about the sort order: well I got that too – but it was to do with the sort order being set the same as another module’s sort order. Make sure its sort order is distinct and all is good. just what was required half hour job thanks Gary! (ps i’ll see what all that tax cafuffle is about next!!)
Rupe – good work. I believe that this is the easiest “discount contribution” to install. I noticed the other two discount contributions have support threads that re 50 or more pages long.
It’s been OK for MS2 since day 1 – I just never tested it until later on…
Cheers, Gary
sort oroder thing: not a problem with this mod – seems to be inherent with ms2.2 just dont set anything to 0. the tax thing – ifyou are happy with applying the coupon after the tax then it aint a problem – i guess some customers might perceive that they are paying (slightly) more but hey they got a discount! thanx again for the work.
Thanks! Works flawless and I am using 2003 verison of OSC.
Hi Micheal – thanks for letting me know that π
Hey
You mention the ‘install’ service but don’t say how much you charge.
I have installed your mod, and it works. Well it nearly works…
I can place an order, enter the code. Get the discount. Pay.. ALL PERFECT
then on my next order I get a coupon has already been applied message… So I can not enter a new coupon etc…
So how much for you too re-install this? I have followed the instructions and just don’t have time to ‘play’ as its on a live store..
Send me an email…
Cheers Alan
Hi Alan – from what you have described, the coupon session is not being destroyed. Look at checkout_process and make sure you have the following towards the bottom;
tep_session_unregister(‘coupon_code’);
tep_session_unregister(‘coupon_amount’);
tep_session_unregister(‘coupon_type’);
tep_session_unregister(‘coupon_id’);
If this does exist in the file (and it is in the right place), then it will need more digging to find the answer.
I charge ΓΒ£25.00 to install this contribution – which guarantees it works or you get a refund. And it does not matter how modded your store is. I’ll make a new blog post showing my charges.
Hi there – this looks great. I have started installing it and ran into a problemthough.
I made the changes in Admin, then went into admin to check it.
Most of the menu options in Admin had gone. No customers etc, down to three menu items and no info on the screen! I have uninstalled in admin and its back to normal.
Have I edited the files wrong, or am I using a wrong version for this…or any other suggestions?
Thanks so much!
Kells – if you did it correctly there should be no problems. I offer an installation service should you require it.
I just retried the install on the admin side and have run into the same problem. The admin are now only has “confugiration, modules, and the top menu item. I can’t see order or customers. I have removed the text but it hasn’t fixed the admin side. Do you know which file could be causing loss of menu on the admin area? If I can just restore that then I might consider having it installed for me – just a bit desperate to get back into admin.
Oh never mind I think I solved it myself – how do you see which version of OS you are using? Maybe its not compatible.Was installed this year.
Kells – here
This contribution is compatible with RC1 RC2 RC2a MS2 MS1
Okay I have installed it completely. When I go into the admin side and select “coupons” I get the followng error:
1146 – Table ‘myname_osc1.coupons’ doesn’t exist
select count(*) as total from coupons
[TEP STOP]
I’m sure its a quick fix but how do you do that?
Kells, you have not run the SQL file in PHPMyAdmin. It creates the database tables that are used by the coupons.
Hello. I complitely installed that mod on a rc1 v2.2.
On a checkout_payment.php , it asking to enter coupon code, but on a last page before payment(checkout_confirmation.php) it doesn’t make any changes. The price is without any discounts. How can I fix that problem? Thank you
Hi Gary, installed this contribution and I can’t see where I have made an error, rechecked and clearly missing something as when I go to check the sort order I get this error code- ( x’s I exchanged here for public viewing)
Cannot redeclare class ot_coupon in /includes/modules/order_total/ot_coupon.php on line 13
A hint to where I made the mistake would make my day.
Many thanks
(another)
Heather
Hi (another) Heather π
Check that you do not have a backup of ot_coupon in the directory that it is telling you;
ribbonrie/includes/modules/order_total/
eg: ot_coupon.phpBAK or similar.
Hi Yuriy – you have not completely installed it as you made the same mistake that loads of other people who did not read the instructions. Read the instructions again, paying close attention to the “sort order” bit.
Don’t forget that I offer an installation service π
Yes, I sent mail to oscshops [at] gmail com about installation but nobody replays…
Yuriy – no email received. Email me again and I will get back to you with a price and what I need to install for you.
Hi Gary
Checked that and nope, nadda, not another thing remotely similar lol! Typical eh?
Yuriy – found your email (in my spam box :() and replied.
Heather – best option is to uninstall and reinstall, or if you have a bit of a budget I can take a look for you. Email me on oscshops at gmail dot com if you want to take that route.
Ok dokey, I shall have another go at it and then will give in and mail you LOL! I so want to figure stuff out and so far I have mainly but somethings just confuse me π Good job I have 3 months to launch date π
TTFN
Gary, Great work! I think there is an error when calculating CAΓ’β¬β’s tax and total in the Order total Modules. I sorted the order in different numbers that applies in the admin/order total modules, the CAΓ’β¬β’s tax and total are incorrect. See actual sample items below:
Camo Backpack 79.95
Sub-Total: $79.95
CA TAX 8.25%: $6.60
Coupon (123) -$5.00
United States Postal Service (1 x 7lbs) (Priority Mail): $9.60
Total: $91.94
This sample applies taxes to item before discount, no tax on shipping. The total is incorrect.
Camo Backpack 79.95
Sub-Total: $79.95
CA TAX 8.25%: $6.60
United States Postal Service (1 x 7lbs) (Priority Mail): $9.60
Coupon (123) -$5.00
Total: $91.94
This sample applies taxes to item before discount, no tax on shipping. The total is incorrect.
Camo Backpack 79.95
Sub-Total: $79.95
Coupon (123) -$5.00
CA TAX 8.25%: $6.60
United States Postal Service (1 x 7lbs) (Priority Mail): $9.60
Total: $91.94
This sample applies taxes to item before discount, no tax on shipping. The total is incorrect.
Camo Backpack 79.95
Sub-Total: $79.95
Coupon (123) -$5.00
United States Postal Service (1 x 7lbs) (Priority Mail): $9.60
CA TAX 8.25%: $7.39
Total: $91.94
This sample applies taxes to item after discount, no tax on shipping. The total is incorrect but CaliforniaΓ’β¬β’s BOE requires tax on the sale amount before any discount. If you are California residents, your sale taxes are incorrect.
Camo Backpack 79.95
Sub-Total: $79.95
United States Postal Service (1 x 7lbs) (Priority Mail): $9.60
Coupon (123) -$5.00
CA TAX 8.25%: $7.39
Total: $91.94
This sample applies taxes to item after discount, no tax on shipping. The total is incorrect but CaliforniaΓ’β¬β’s BOE requires tax on the sale amount before any discount. If you are California residents, your sale taxes are incorrect
Camo Backpack 79.95
Sub-Total: $79.95
Coupon (123) -$5.00
United States Postal Service (1 x 7lbs) (Priority Mail): $9.60
CA TAX 8.25%: $7.39
Total: $91.94
This sample applies taxes to item after discount, no tax on shipping. The total is incorrect but CaliforniaΓ’β¬β’s BOE requires tax on the sale amount before any discount. If you are California residents, your sale taxes are incorrect.
Any idea how should I fix the error. Thanks for a great work! Pam
Pam – this version does not deal with Tax – that’s why the total is slightly out π
The latest version does, but this is an experimental version which needs to be installed by me. Throw me an email on oscshops at gmail dot com and we can go from there.
By the way – it appears that in your examples above, Tax IS being charged on shipping at 8.25% – check to make sure.
Is there a way to only give the coupon to certain categories instead of the whole site?
Mike; No.
Thanks for the contribution Gary, I was floundering until I realised you had to ‘install’ it in the order_total section of admin. Looks like a few hit this, I think it’s ‘cos you decide on option 2 in the readme and believe that’s all there is to it without realising there are more steps. All working now.
Is it possible to add an option to make a coupon useable once only rather than once per customer? In a gift voucher situation you don’t really want the voucher useable once it’s been redeemed if someone else was to get hold of the number.
Cheers,
Greg
Greg – that’s certainly possible. Just needs a portion of the contribution recoding – maybe something on the to-do wish-list (which is getting longer day by day) ;p
Thanks Gary. I’m sure you’ve got a number of additions to make but from my little knowledge of coding I imagine (hope) it would be a relatively simple addition to the existing structure which would extend the contribution’s functionality significantly, rather than building a whole extra module (such as the ‘only for certain products’ which I think is a great idea but a lot more work). If you get the chance to have a look at it I’ll be first in line to test it! π
Greg – some of the stuff that people have been asking for is “interesting” to say the least. I’m only coding stuff that is useful for the majority, not the minority (unless the minority pay for the pleasure – and most of them don’t want to). What you want is something I can see that would be useful – but when I get around to it is anyones guess.
Hello and great work my friend.. I just wondering if you are planning to make any addon that will make a feature to let customers buy those codes like a products, and give them to their friend.. That will be great if you make it..
Chris – that’s for a future update…
hey mate,
i have tried to install the contribution and started with the admin side, i have changed all the text and uploaded all the files and when i go into the admin panel i get a plank page!
any ideas as to what i have done?!
cheers
Euan – you have installed it incorrectly – start over.
hi dude,
you recently replied to my message on the osc forums when i asked about discount codes. problem is, i’ve followed it all through and everything ‘appears’ to be working, as in, i dont see any errors anywhere, BUT at the same time, on the checkout page i dont see any discount applied?
can you help?
thanks
Shelton
Shelton – uninstall and reinstall. Follow instructions closely, INCLUDING the “usage” instructions. If you don’t able to get it working, I offer an install service.
Nice contrib – easy to install, but have one issue that I didn’t find in the posts preceeding.
My installation uses Authorize.net for CC validation, and we incur a charge for every transaction. This is the only payment method.
I install GV&DC, and want to give away some product promotionally, so I can set the Admin to use a voucher 1 time, and set the discount to 100%, and the sale totals correctly, but because I’m using A.net, I’m getting charged the transaction fee.
How can I adjust in Admin, or in the code, to allow a 100% discount without the transaction fee?
Roger – I don’t have any experience with Auth.net so cannot help you, sorry. Couldn’t you enable a different payment method if the voucher amount is 100% ? See here for more info.
Hey Gary,
I have installed the contribution and followed your instructions carefully. I am getting no errors whatsoever, but the discount is not reflected in the total. I had no problems running the SQL in PHPMyAdmin. I double checked and made sure all files were added/modified correctly. I only had to modify 1 file (includes\languages\english.php) and that modification was very simple. The rest of the files were replaced and all the new coupon php files were added. I double checked and all the files have been uploaded, but still no discount in the total. Any idea what the problem could be? I am running MS2-060817, which you said it should “work fine.” Please help.
-Mike
Mike – read instructions, particularly “usage” instructions. If you need it, I offer an installation service. Email me.
H, I have downloaded the discount coupon codes, but after extracting the files, the site is
still not working nor any column for discount ode an be seen.
Please help by guidung step by step to include the discount at the payment mode.
lynda – read instructions, particularly “usage” instructions. If you need it, I offer an installation service. Email me.
Hi there, this is a good contribution, installation is straigt-forward. I have a couple of questions though. Do you think for a future version, you may add functionalities such as restricting the amount of use by customers, currently it’s once per customer as perhaps “this voucher is applicable to the first 200 customers”. In addition can you you assign a voucher to a certain category, such as “Motherboards”. Furthermore, can you put an expiration date on certain vouchers. That’s it. Regards Elroy
Elroy – thanks for the suggestions;
“restricting the amount of use by customers” – probably not.
“assign a voucher to a certain category” – definitely not.
“expiration date on certain vouchers” – yes, that’s coded but whilst coding it I introduced a bug that needs to be solved.
By clicking the “Confirm order” at my site, bring up a blank white page. There is no error or whatsoever.
I have latest version. even uninstalled and reinstalled.
Any ideas would be appreciated.
Thanks.
Bennett
Installed incorrectly. As you’ve already tried a couple of times, you might like to have me install it. My email address is up there ^
Thanks. Now am looking for possible error. Did remove and still error. Now am looking at previous mod. Will get back after results.
Bennett
Hi, I need help with the Parse Error.
Parse error: syntax error, unexpected ‘)’ in /home/memoriez/public_html/catalog/admin/includes/boxes/customers.php on line 28
Please help!
Thanks!
Hey, thanks for the initial code, i have tried several ccdv mods with no luck. I have found a silly problem with the code. It seems although i apply a percent coupon it discounts as a fixed coupon. For example
Sub-Total: $49.99
CA TAX 8.25%: $4.12
Coupon (10%OFF) -$5.00
In-person Pickup: $0.00
Total: $44.11
Quite peculiar i know. Is there a particular file i may have switched these two associations? Perhaps the database tables? Your help is greatly appreciated. Thanks in advance.
Adoncia – take a look at the code for the “install on brand new” folder – particularly the files; admin / includes / boxes/ customers.php – and compare it to what you have live in your server…you might see a difference..
Dennis – 10% of 49.99 is 5 (rounded up).
A couple more tests, it seems the coupons are being doubled and deducted. The fixed vs. percentage works great. Which file might be calling this deduction twice? TIA
Thanks for the prompt reply Gary and your support, sorry to flood your board. Im thinking maybe my problem is with the database…would that make sense? Im going to get some sleep and try to figure this out in the morning. π
Hi Gary,
I used the code in the “install on brand new” folder. However, the link doesn’t work. Can pls assist?
Thanks!
Adonia, follow the parse error instructions. There must be an extra ‘)’ in your code that you did not remove. Start looking on line 28.
Gary- This may be a long shot, but might the discount amount be doubling because it is applied as euros? My subtotal is in dollars so is it calculating 1 dollar = 0.5 euro??
Adoncia – as Dennis rightly says, work your way through the codebase until you find the error…
Dennis – shouldn’t make a difference as the modue is independant of currency issues. Make sure that the discount is not going into the database twice.
Is there a reason this is packaged like Admin folder then catalog
shouldnt the admin folder be in the catalog?
Ray – only if you have your shop set up like that. Admin files go in the admin section and catalog files go int he catalog section – regardless of where it is installed on your live site. I’d suggest that a majority of live shops don’t use a /catalog/ folder anyway!
After installing this contribution, it shows the following
error message at administration/customers/coupons.
Coupons
Coupon Code Coupon Status Action
1146 – Table ‘db251051003.coupons’ doesn’t exist
select count(*) as total from coupons
What should I modify it and make it function. Thanks.
gosamba
Wow this is a flawless contributuion, we use a heavy moded 2.2 MS2 it took me a little bit, I had an OLD coupon.php lingering that never got replaced so i had some tep errors and I then relized all files might not been replaced or updated, I took a good look and double checked it all and made the replacement and BANG@!
Works great
thanks a bunch
Gosamba – you have not run the SQL in PHPMyAdmin.
GMD – good work!
I’m not sure how many beers u will get for 50 bucks, enjoy your weekend keep up the good work
GMD – thank you very much. You have made my day π
I have encountered the following error
1366 – Incorrect decimal value: ” for column ‘value’ at row 1
insert into orders_total (orders_id, title, text, value, class, sort_order) values (’36’, ‘Coupon (abc)’, ‘-RM8.01’, ”, ‘ot_coupon’, ‘3’)
in checkout_process.php. After checking the codes i notice in ot_coupon.php the the value was set to empty.
(‘title’ => TEXT_COUPON . ‘ (‘ . $_SESSION[‘coupon_code’] . ‘)’,
‘text’ => ‘-‘ . $currencies->format($coupon_discount, true, $order->info[‘currency’], $order->info[‘currency_value’]),
‘value’ => ”);
Could this be the cause of reason the SQL is set to ”
Thanks
Chong – could be any number of problems. I suggest to re-install – the easiest way is to create a new test shop and just install the brand new files. Alternatively, uninstall and re-install – but this is usually not fruitful as if you made a mistake, you are likely to make the same mistake again.
Go over your files with an eagle eye.
Hi Gary,
Is the value meant to be ” or it suppose to carried certain value instead of ”.
Chong – reinstall – if it isn’t working, it isn’t working.
Gary,
I have installed the files and run SQL with phpmyadmin. When I was setting up the coupons in the oscommerce admin section, everything seemed to be going fine. I was able to create a coupon, and install the coupon in the order total module. However, when I went to do a test transaction, there was not a field available for me to enter the discount coupon code. Its seems nothing has shown up. Then when I tried to continue the transaction, I ended up at a blank checkout confirmation page. Any idea what my problem is? Ive tried reinstalling the coupon code, but still have the same problem.
Dave – definitely a dodgy install. Keep trying, and if all else fails, know that I offer an installation service.
Gary
fyi… we are running our website live with os commerce v2.2 RC2a, if that makes any difference
Dave – shouldn’t make any difference – this contribution is written specifically for RC release of osCommerce…
One little thing I found with this have no idea why. I have installed this mod on 2 different sites.One site 2 times installed it. (both are with the same host.) But for some strange reason I had to re test the codes a couple of times then bingo would show the discount being used.. Would take about the 3rd code I used that it seemed to kick in. Like the site gets stuck remembering how checkout was then fixes up to how it should with the discount.
Cass – sounds like an issue with session – check you added the session start on the correct files.
Gary, great job thanks for your efforts.
I have read through the entire forum and notice a lot of people have the same issue as I, which is you can enter the discount coupon, however on the Order Confirmation page, the discount is not shown INITIALLY. If I press F5 and reload the page, then upcomes the discount. Of course following the order through, it works perfectly, ie shows up on my invoiced etc.
I am testing osC 2.2rc2a on my localhost, and have placed the Coupon Order Total Modules in Sort position 1 to ensure its calculated first.
I have noticed above and in the forums, that people also have had this problem with a similar contribution GVDC. I have double clecked the code to ensure I have made no errors, and as it does work correctly I assume I havn’t made any mistakes.
Do you have any ideas / hints as to why the applied discount is not Initially shown.
Thanks
Troy – session is not registering – you need to make sure you added all the session bits and pieces to the checkout files.
For anyone having problems, I offer an installation service. Guaranteed to work correctly or you pay zero.
Well done Gary – thanks.
Mikey – you are welcome.
I just installed this on a fresh RC2a – works wonderfully.
The only problem I’ve noticed is that you cannot remove a coupon once it has been applied to an order. Is there any way to do this?
I enter the code in, but no matter what I do (empty cart, log off, etc.) I cannot pull it off the order… what if the customer changes their mind? There is no way to un-apply it.
Sethman – I couldn’t think of a situation where a customer would want to unapply a discount?
I can think of a whole bunch of reasons, lol.
1.Customer forgets how much coupon is good for – just wants to apply and see, then remove for use later.
2.Customer decides he wants to give it to someone else, but can’t pull it off.
There are more. But it just seems that to be “user friendly” and to keep people from getting frustrated, there should be the option to remove it from the current order.
I look at it the same as when a person puts something in their cart to see the final price w/shipping. Just because they are looking at how much it costs doesn’t necessarily mean they will buy the item (or in this case use the coupon).
Sethman – I guess that makes sense.
Alternatively, an idea might be to have an input box infobox where the person can check how much the coupon code is worth without having to go thru an entire order?
Whichever way, it would probably make a good upgrade for the future π
Gary – Great addon! I love it!
Just a quick question. I cant see a place in the admin section to see whether the coupon has been used, is there one?. I was looking at the coupons.php to see if I could add a column next to the coupon status saying ‘Coupon Used’ and either yes or no, or a 1 or a 0, or something similar. Would this be an easy thing for someone to show me?
Many Thanks
Milo – at the moment, coupon use is seen in each individual order. It shouldn’t be difficult to make a “coupon used” column, but it’s not something that’s useful for me, so I wouldn’t make it as part of the contribution. I suppose if someone wanted to sponsor development of that part then it would be possible to find some time to make it.
Gary – Okay, thanks. Ive not been using php that long, or even at all. I can read it but cant write it. I will see what I can do and if any success I will post the code here (if you want me to).
Thanks
Milo – great, go ahead π
Wordpress doesn’t like code being posted in comments, but feel free to email any code you come up with and I can add it to the contribution maybe. My email address is up there ^
Cheers, Gary
After spending weeks messing with another discount coupon contribution I came across this and have installed it but ran into a problem – no matter what I do I cant get it to actually apply any discount (% or fixed) to an order. Im using COD as the payment type for all orders and have one coupon code set up – when I enter the code and click continue it shows up in the information as Coupon (correct coupon name) but a value of zero. Likewise in the email confirmation the same information is passed but no actual discount applied.
Im using FEC and I *suspect* maybe this is part of the issue – the code which you said to insert into checkout_payment in the instructions I put into checkout_shipping instead as FEC doesnt use checkout_payment but that code is mostly just HTML with a few if statements to check if the coupon has been used before and shouldnt make a huge difference (famous last words……)
Any ideas at all? From memory and looking at the code I dont think FEC makes a huge number of changes in checkout_confirmation where the discount is not being applied so not sure where to turn :/
Jase – very easy solution π Uninstall FEC – FEC is a poorly coded piece of cr4p !
Hmmmmm well I would (and I actually only installed it because I couldnt get PWA to work and FEC was a very definite second choice) but I really do need the functionality it offers as I know from previous ecommerce and OSC experience that a lot of customers associate signing up for an account with getting buckets of spam and it does tend to put people off buying which I obviously want to avoid!
As a matter of interest, does your code work with PWA? The issue I have with PWA is there are no intructions how to install it over a modified OSC instance – just the replacement files are provided and as my store is heavily modded I couldnt even begin to try and compare the files manually to find out where to put the code etc π
Jase – “does your code work with PWA” – no idea. Not much use am I π
Hi Gary,
This coupon is a nice contribution. I did email you about a problem with paypal express.
Basically, when using paypal express to checkout the coupon code is not deducted from the order. Paypal standard works fine but paypal express takes you to paypal and then back to the store and that’s where it gets messed up.
If I’m missing something please let me know.
Thank you!
Hi Melinda
Paypal express cuts out (part of) the checkout process, so any contributions which are coded for checkout will not work.
It’s a possibility that the coupon code could be activated prior to checkout (say on the shopping cart page), you can have a go at recoding it?
Cheers, Gary
FEC gone – going to start and try to install your contribution again so fingers crossed!
It works – thanks v much Gary π
Jase – good work π
Gary,
Super contribution it works perfectly and does exactly what is says on the tin!
I do however have one problem which I am trying to eliminate. Using PayPal IPN I dont get any order confirmations and all the issues that go with that (stocklevels, cart not emptying etc.) I have read that if any changes are made to checkout_process.php they have to be duplicated in paypal_ipn.php and ipn.php. Your program is the only mod I have that changes checkout_process.php, so I am wondering if:
1. Has anybody else come across this issue?
2. If they have what is the solution?
3. If 1 or 2 dont apply, do you have any ideas on what I am doing wrong?
Thank you in advance.
Ian
Ian – thanks π
Some of the Paypal stuff does bypass areas of the checkout. THe coupon contrib doesn’t touch many files so it should be easy to work in.
I don’t have “admin > customers > coupons”
Its present at “order total modules”
in the OSC forums I’ve replied to you, but I have to contact my host.
any ideas right now?
Mark – if you don’t have a “coupons” link in your customer box in your admin area, then you have not installed it 100%…so my advice wouold be to go back over the install instructions and see if there is anything you have missed. I offer an install service if you cannot go forwards with it – if interested please email me, my email address is up there ^
Hi Gary, I have the MS2.2 version of osCommerce and would love it if you could email me a version of your Gift-Vouchers contribution to install on my store. Many of the others I have looked at require other contributions to be first installed, and don’t seem to be as simple and logical as yours appears in the video.
In anticipation, Rob.
Rob – http://addons.oscommerce.com/info/5743
Cheers, Gary
Gary – I have my site set to use free shipping for all orders over ΓΒ£50 but as the coupon is applied AFTER shipping is calculated it means that some customers are getting free shipping when they shouldnt be as the coupon takes them back below ΓΒ£50.
For example, if the order value is ΓΒ£55 before any coupons are applied and the customer then uses a 10% coupon the order value is now ΓΒ£49.50 which shouldnt qualify for free shipping but they still get free shipping as the new order value only kicks in at the last stage of the checkout. Any ideas how to overcome or work around this?
Jase – changing the sort order of your modules *miht* cure it. Have shipping mod after the coupon.
My current sort order is:
Sub Total
Coupon
Shipping
Total
and it still doesnt work properly – might try and put coupon first and then sub-total and see if that works…..
The coupon is applied only to the order_total, so the shipping should kick in on the order_total. Hence I would say that it is possible that my codebase is incorrect or that the free shipping module codebase is incorrect…
I have added GV and DC RC1 RC2 RC2a v1.2 coupons > how ever find that upon using a fixed amount coupon, transactions can turn negative, is there anyway i can set a minimum order value for the coupon to be used.
Currently if the sale is for $3.99 and the customer has a $5 coupon the sale turns negative.
Any ideas on how to get around this would be great
Thanks
A minimum order value is a good idea. I’ll add that onto the to-do list – when I get around to it is anyones guess π
Hi, please can you email me the Discount Coupons install for the older 2.2 MS2 version of oscommerce
thank you
Butcha
Wondering if this contribution is what I need. I need to be able to purchase gift certificates and redeem them online for my store. My client also wants to be able to add a discount to one item and take a percentage off an item not the entire order.
Does this contribution do that? Thanks!
hey i can’t seem to find the coupon module anywhere and everyone here seems quite satisfied with the job you’ve done can you please send it to me pleaseeeee
Is this add on trackable? In other words itΓ’β¬β’s been used 200 times during Sept or whenever. Can it be auto applied via a click through a newsletter or something like that?
Steve – Version 2 and Version 3 of this codebase has a feature whereby you can click a link to see all uses of the coupons.
Image (usual view):
Image (detail view – you can see links to each order):
Oliver – you can download Version 1 of the code at the oscommerce contributions site.
I’m installing this add on to an already set up store, and am not quite sure exactly where to put the ‘checkout_payment.txt’ into the ‘checkout_payment.php’ file. I finished all the other mergings, and the last few had specific instructions on where exactly to place the new code. The ones that did not contain specific instructions were pretty self-explanatory
This one is a little different though; if I put it at the end, all the processing has been done. If I put it in the middle, I’m unsure if it will work…
Please help!!!
Steve
Steve
Any where in that file is fine – I usually put it about the “comments” box towards the bottom.
Gary
Hi, i installed the module onto a ms2.2 store after reading your email. All is fine but the discount is not applied to the order at all.
everything else is working, any ideas on how i can solve the problem.
Cheers
Butcha
Make sure sort order is unique and that the order total module is installed. You can email me on oscshops@gmail.com if you wish to enquire about installation prices etc
Thanks for your fast responses, Gary! Your add on works like a charm…!!
Steve Tipton
Hi,
I’m just wondering if you would be interested in allowing my contribution to this project. You see, early on you had someone requesting if your contribution plays nicely with SPPC Separate Pricing Per Customer, well it does. I am currently running SPPC and your contribution on my website without any problems. It took me a while to figure exactly where to put some of the codes, but i managed to do it. If you update some of your txt files so that the average joe doesn’t have to do a hunt and peck to get it right it would be appreciated. Anyhow awesome contribution;)
Rob – good work! – I prefer that you package this up yourself and maintain it etc. Cheers.
If you do package it up, please make sure to call it something completely different so that users do not get confused and come here for support on yours and vice versa.
Hi Gary,
Great contribution! I’ve installed it and it worked nicely.
May I suggest something that you can add for coming releases. Is it possible to incorporate a ‘return customer’ discount method into your current system? I’ve seen some contribution on that (the ‘Easy coupons’ with automatic coupon option)and I hope you could add something like that into your contribution.
I don’t want to have multiple discount system in the shop as it will probably cause trouble and hard to organise.
Thanks
ps. Your discount contribution and how to is the most user friendly discount contribution out there. Others are so hard to understand and execute.
Ayman – what you would do is create a permanent discount code, on a “use once” basis. Show this code when they log in…or maybe have it in the email that is sent when they make a purchase.
Gary,
Yeah, i do thought of doing that. But, wouldn’t it be troublesome when you have a big number of customer that you need to keep up with? Knowing who shopped more, who first time buyers are and who are your loyal customers could be very confusing.
Hi, first thanks for this contrib, really good stuff!
I have installed in the site, and for some reason its causing a bug with my credid card check out proccess, works fine with paypal, but when i choose the CC processing that i use a linkpoint contrib(that was working before i installed the coupons contrib)
i’m using v2.2 RC2a and basically when the order goes through the linkpoint process but its not going in to the cart admin…it acually goes through linkpoint and charges the card, but the order is not showing in os commerce. any ideas what could be causing this?
Thanks for you time!
E
ahh nevermind…it was a mistake on my end…works perfectly!
thanks again for the contrib!
E
Great contribution, thanks!
Question: What would be the best approach for adding a second GVDC box so that customers could receive a discount AND redeem a gift certificate? Can I simply repeat the installation so that two discount boxes appear and both a discount and gift certificate can be applied to an order? Do I need to rename the second installation so there is no confusion during checkout? Also, is there any easy way to NOT allow certain items to be purchased with discount codes (i.e. gift certificates)? I have my gift certificates set to not have sales tax applied to them. Could I use a similar approach to not allowing the discount codes to be applied to a particular item?
Thanks!
Jonathan
Jonathan – having more than one discount would make price and tax calculations very complex. However, I see no technical reason why you could not have more than one discount at a time – would take some coding skills but shold be doable…
hello, Thank you for this contribution. Since is my first contrib. install.
i set up the coupon on the admin, but when trying to buy a product it comes up
at the bottom of the checkout_payment or(payment information) type the code* click continue to next page Checkou_confirmation.php or (Order Confirmation)
I see Sub-Total: $70.00, Flat Rate (Best Way): $5.00, Total: $75.00 But
Don’t see the code discount in this page.(i did install in admin-order total module coupon! What have i missed? It does not show up like in your video sample. Also using RC2a
Thanks π
when u are done ‘ don’t forget to check the ordertotal module and have the orders correct, my coupon didn’t come up at checkout bc of that’ !
Great Contribution!
Good work Hanna. That’s the exact problem that 90% of those who say “it doesn’t work” need to check on.
Hello, quick question.
When the customer adds a coupon, and goes back to the payment page it says “A coupon has already been applied to this order” How would one go about making that message say like. We have several different coupon options from percents to cash.
“A 10% coupon has been applied to this order”
“A $5 off coupon has been applied to this order”
and then after that message, a button that says “Click to remove this coupon” in case they want to choose the percent over the $5 off.
Hank – with this coupon contribution, only 1 coupon may be applied to any order. v3 has the facility to remvoe a coupon after it has been applied, see here, however v3 is unavailable to the public at this point as one portion of the codebase (that deals with tax) needs to be set up on a store by store basis, hence I install it at low cost.
A rather enticing add-on, I have gotten it into admin and the space for discount code is showing on checkout and have completed a transaction.
However, on checkout the USPS module (the original USPS module included with v2.2 RC2) is now broken and giving the old “An error occured with the USPS shipping calculations.”
The demo site was in-sync with the live site via shipping options, so I did not know if this was something that came up before. I realize it makes no sense.
Thanks
Hi, I’m desperately looking for a discount add on for my site. Someone from another forum sent me here.
Thanks so much,
Kert
Any tips to make this work correctly with the Paypal IPN module?
Chapman – how about recoding the IPN module so that it works correctly π
hwkd – it shouldn’t affect any shipping modules as the coupon system affects only the order total. Unless of course your shipping is based on order_total!
I’ve installed it 4 times and everytime got the same problem: when I click on coupons in clients, I’ve got ‘Access failed . Any access is not valid!
Please ccontact the administrator of the site in the event of problem of access’
I’m working on 2.2 MS2.
Thank you for your time.
I have installed GV DC RC1, RC2, RC2a V1.2
Tried it and it did not apply the discount, just kept the same price. In admin it doesn’t say $’s, could that be the issue? I do not have any currencys except $’s and English installed
GV DC RC1, RC2, RC2a V1.2
Coupon Type
Fixed: amount in ΓΒ£s & pence
Percent: percentage discount
ΓΒ» Fixed
Coupon Amount
10.0000
Chuck – it should not matter about the currency.
Denis – I have not seen that error.
Both – take advantage of my installation service. Guaranteed to work or you pay zero. Contact me on oscshops@gmail.com
Hi, works fine for me accept when i use a payment module by a third party provider. The total sum without the discount. How can I code this my self? They do something like this to get the total
$order = new order;
$pay_cents = number_format($order->info[‘total’] * 100, 0, ”,”);
I would like to deduce the total with the discount total. How can I extract this?
Many thanks…
//t.
This contribution rocks! Hell ya! Seriously… I have tried ALL of the other GC/GV options available, and none have worked until I found this one. Excellent! Where do I donate?
Thanks,
Mike
Mike – glad you like it. Please do buy me a beer by clicking on the beer icon on this page. Cheers!
Tomislav – the module changes the total, so your payment module should pick that up. If you test it using a different module (eg, cash on delivery) does the correct amount (including dicount) show. If so, then you know you have to fix the 3rd party payment module…
Hmm… i think its to the third party module which has its problems. Do you by any chance have any suggestions on how I can extract the coupone amount for the order?
//t.
T – if you send to me the file for the 3rd party module, I can take a quick look and let you know; is it fixable & how muich it will cost. oscshops@gmail.com
i’ll send you a copy, but what I am missing is something in the classes/order so I can extract the coupon value if its possilbe…
//t.
Hi Gary, I installed your contribution on my OSC-RC2a and it looks like it’s all working, Yeah !!!! You’re a genius, ’cause I certainly am not in this field and I got it working with your instructions !!! I’m over the moon!
The only question I have is that in the admin/customers/coupon field there is a mention that the value amount of the coupon is in Pounds and pences (or percentage, so I choose this option now) I am in NZ and would need Dollars. can I change this ??
Hi Joyce – you should be able to change this in the language file; /admin/includes/languages/english/coupons.php – it’s only text and should not really be there at all. in subsequent versions of this (it’s now at version 4) this has been removed. I’m about to blog about Version 4 later on today.
Oops, celebrated a tad too soon. All is working in Admin and looks all in the right place, but then I go to check out and the two last pages are all broken up. I must have done something wrong merging the .txxt files in the checkout_confirmation.php; checkout_progress and checkout_payment.php files, but what?
Joyce – could be any number of things. Copare your files against the files in the download. Not the txt files but the other php files. That should allow you to see the problems.
Note also that I offer an install service should you need it – installation is presently v4. Installation is cheap and guaranteed to work or you pay zero.
Hi,
You module sounds like the one i have been looking for. I have RC2a and MS2. My current site is ms2 but i am updating the site to RC2a
Thank you
Gary GMD is back π
I installed this for MS2 and i got it working so I tought, well the order history, email and everything shows the correct amount but the Paypal Pro – Direct Credit Card still charge the full price.
I dont mind to send you some more beer $$ if you can help me out
GMD – lots of payment modules are incorrectly coded. If you try a different method (eg cash on delivery) you should see it working OK – assumes of course that you installed it OK π
So, what you need to do is see how the COD method grabs it’s “total to pay” and see how the paypal does it too – then correct the paypal one…
Gary
Of course cash on delivery works, the cart works and hold all information corrct based on discount, on admin side, and customer side the problem is the data that sends to paypal,
I sent you an email I think i need your help here, last time I sent you 50 bucks beer and I would love to contribute some more..
HI Gary,
Thank you for all your work and help, looks like a great contrib.
I would like to try to install this myself. I have a couple questions.
I do not know PHP very well, I have managed to install quite a few contribs and can customize OSC pretty well but I am a real greenie, so my question is where to insert the code from the text files into the php files of the same name? most of the define lines seems pretty easy to put anywhere, but the other code for the other pages it does not seem apparent where I should insert the code.
Next, does this contrib work with other common payment modules like Authorize.net?
Thanks for your help.
Jacson
Hi! I’ve just installed discount coupon codes and i’m unhappy with it.
I’m curious about this, is it able to exclude some manufacturers from the discount? So each manufacturers on my shop can set their own discount? (freelancers) if not, are you planning to implement this?
/Andreas
Andreas – I have no plans to implement anything like that.
Jacson – if you download the package from the contributions area, you will be able to see the thing installed on a clean version of oscommerce (install on brand new) so that you can compare the files. I offer an installation service should you need it.
Hi,
Been looking at this contrib and have a quick question. We are currently doing some party plan stuff (selling at peoples houses at parties) and have a number of “agents” who do this for commission. They want to advertise the site aswell and wanted to know if I use this contrib can I issue each of them a voucher code for “their” customers which I can track when it is used and pay them futher commission for repeat business??? i.e a voucher give 10% to the customer which I can then track orders using that voucher?
cheers
james
James – in MVersion 4 of this modification, it is possible to see orders made using each coupon.
As asked by someone else earlier — I can not figure out how to sell gift cards via my catalog can anyone point me into the right direction?
Please let me know
Thanks
Tai
Tai Kahn – You would make a product, and then once a person buys it, you would make a gift voucher to equivalent value and let the buyer know the gift voucher code. That’s not automatic, obviously.
Now I have the “coupon” side completed, I can carry on and make the “gift voucher” side (so it is all automatic) – I’ll make a blog post about this in the next days.
Looking forward to the automatic method. My customers want to buy a gift certificate and check out, and never call and have it emailed to their son/daughter/etc for the holidays.
Tai
HI there,
I am looking for a copy of this for MS2 can you make it available?
Thanks
Tom – http://www.clubosc.com/coupons-for-ms2.html
Is available installed for about ΓΒ£25.
Hi Gary,
There is nothing for download at that link, it just says to contact you if you need this. Should i email you?
Hey Gary, nice work! But I got one problem. I need to show the included Tax of 19% (Germany) from the Summary and not the Tax from the Product.
What I want is this:
Product 100.00 $
Shipping 10.00 $
Coupon -50.00 $
————————
Summary 60.00 $
incl. Tax 19% 9.58 $
I got in the moment this the incl. Tax from the product, but this is wrong, need show the Tax from the Summary (please also the bills in the admin must show the above example:
Product 100.00 $
Shipping 10.00 $
Coupon (1002) -50.00 $
————————
Summary 60.00 $
incl. Tax 19% 19.00 $
Please help.
George – this version does not support tax calculations. I have a “working with tax” version, but it needs tweaking from shop to shop hence the need for an install by me.
Hi Gary,
can you give me the working with Tax version pls, I have to install it of my own because the shop is already running and the shop owner don’t want give access to server to foreign people. I will donate your work, if it is the solution I’m looking for. How much you want for the solution and installable documentation?
Greets George
Hello George – it needs to be installed by me.
Gary
i downloaded GV and DC RC1 RC2 RC2a v1.2, even thing is ok except one thing, when i try to check out i get the following error
Warning: Cannot modify header information – headers already sent by (output started at /home/******/public_html/user/classes/boxes.php:912) in /home/user/public_html/includes/functions/general.php on line 40
I think this problem occured because of the followinf file before the header
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’];
}
Fabian – google is your friend. I also offer an installation service (should you need it), which guarantees a working install of v5 Coupons.
Hello . I have installed you contribution but i have only one problem
at admin/includes/boxes/costumers.php
where should i write this code ” ‘‘ . BOX_TOOLS_COUPONS . ‘‘ . ”
what should i do ? thank you !!
Hi Gary,
Many thanks for the contrib, it is exactly what we have been looking for.
I have a couple of queries though:
1. I took great care over the installation, and believe that I completed it correctly as stated by the instructions (performed an offline and online installation, both with the same results).
Is it correct that when a discount code is entered and the customer presses continue, even if they don’t complete the order, and may even log-off, when they come back (and log-in again) to make a potentially different order, the code is automatically still active, and it is stated that a coupon is already being used for this order?
2. Prior to installation, orders were not appearing in the orders section of Admin, or the order history area of the customer’s My Account, until Confirm Order was pressed (and in the case of my site, they are transferred to Paypal for payment). However, it now seems that the order comes through as soon as the customer reaches the Payment information stage of the checkout process(where the result of the coupon and resulting total is first displayed).
Could this be a result of the installation? And could you suggest how this can be fixed so that the order is only sent through when ‘Confirm Order’ is clicked?
I would be happy to elaborate further via email if necessary.
Many thanks,
Mark
Paul, easy answer – compare the file against the other in the download – see previous comments in this thread. Cheers, Gary
Mark;
1. Possible – you need to destroy the session.
2. I don’t think that this is due the contribution.
Cheers, Gary
Hi Friend,
I installed the gift certificate mod. it works good but the problem is it doesn’t show the calculated price after applying the coupon.
I checked my installation 3 times and found it seems everything is fine. but still no luck with calculation.
Please note I am currently testing it on my local wamp server.
Thanks
Ali – most likely you have not enabled the order_total module and given it a unique sort order.
thanks for your reply Gary,
Can you help me and explain how to enable order_total module and unique sort order?
Thanks very much for your help.
Ali
Hi,
I got it fixed by enabling order total module and assigned a unique sort code too. Just one question.
now it shows the total like this
Sub-Total: $29.99
Flat Rate (Best Way): $5.00
Total: $34.99
Coupon (123) -$5.00
so the coupon amount is in minus and displayed after total price. that means the user wouldn’t understand if the total is still the same or reduced by the discounted price?
Thanks a lot for your help.
coupon works fine but still doesn’t calculate the exact total after discount. it just shows the discount on order confirmation but the total stays as without discount and same total is shown in admin/orders page.
Also how does Gift certificates work? I basically want to sell gift certificates on my site.
thanks a lot for your help.
Ali – follow the instructions π I offer an install service if you cannot manage it.
How much do you charge for it?
About 50, usually. Email me on oscshops@gmail.com to discuss this further, if you require the service.
Hi Gary,
Just wanted to say thanks for putting this together. It’s exactly what I was hoping it would be. Your install notes, and support here are perfect too.
Jez
Jez -cheers :thumbsup:
-=-=- Fix for “A coupon has already been applied to this order” -=-=-
Ok, if you’re running a Paypal checkout and trying to get this (rather fantastic :)) mod running, you might be running into the problem that the coupons don’t delete themselves.
This is due to the fact that Paypal doesn’t redirect you to checkout_process.php, it directs you to checkout_success.php.
Simply take the code that should be in process.php, and move it into success.php, and the coupons should work fine π
One problem i’ve run into though (not sure if it’s because of my ‘fix’ to the above problem?), everything works fine except I can’t get the coupons to only work once. I set them to single use in the admin, but I can keep using them over and over π
This looks like a really great mod, it does exactly what I want it too, if you could just shed some light on why this isn’t working, would be much appreciated π
Cheers,
Lewis.
Me again, just tested it and if i delete the coupon inthe admin section, I get a nice red box with “invalid coupon” when I try to use it, is there any way to get this to happen once they have been used once?
Lewis – what needs to be fixed is the way that Paypal works (in relation to osCommerce). All finalised orders SHOULD go thru checkout_process…
The contribution does not have a “use once, one time” coupon, however the latest version of the codebase does. Ther latest version is not available as a download, only it is available installed by me at this time.
Hmm, well I do like the looks of this mod, how much to install?
I’ll have to talk to my co-worker, but that should be fine π
Gary, nice work. Quick question – if a buyer has two coupons (say a $10 one and a $20 one)and wants to buy something for a total of $30, is there a way of them being able to apply both coupons to the one purchase?
Simon – in my version, only 1 coupon code can be input per order. More than this causes all sorts of problems with tax, sessions etc.
So, your buyer with two codes would need to decide which one to use. In the latest version of the code, I have a “remove coupon” link which can be used to “test” which coupon they would want to use.
Thanks for the prompt response Gary. Looks like my client will have to process this sale manually while I think of a way of adding functionality for more than one code. Or not!
Cheers.
Simon
Hi Gary – and many thanks for the great contrib.
In catalog/includes/modules/order_total/ot_coupon.php (about the line 44, at the end of $this->output[]… ) you wrote ‘value’ =>” so the value of the discount in the orders_total table always stays 0.0000.
I have changed this to ‘value’ => 0-$coupon_discount to get the negative value of the discount, so that I can use the value in other calculations – for example sum the subtotal value and coupon value with a mysql command.
Is there a reason why did you wrote the code in that way (‘value’ =>”)? I’m asking you because I don’t know osCommerce as good as you. Perhaps it is better to leave this value empty to avoid some complications on some other places in the shop?
Another question: if a customer has typed the coupon code in the input field, logs out immediately after that (without buying), logs in again and wants to buy some other things (or the same things, it doesn’t matter), on the checkout_payment.php he will see the message: “A coupon has already been applied to this order”. I supose this happens because of the session that is still active. What do you think, is it a good idea to put your 4 tep_session_unregister(…) commands in the logoff.php file to avoid this?
Many thanks
G.
Hi Gerard
I can’t remember why I left that blank – having tested it, it seems OK with the value in there. so I would say to use it with the value. I’ll update the codebase.
Yes, in v5 of the codebase I have the unregisters in logoff.php – put them towards the top underneath the other unregisters, and before the tep_redirect
Cheers, Gary
I just installed your contribution and it seemed to be working great but them I noticed that on the checkout_confirmation page it applies the coupon amount twice. It’s odd because it applies it only once on the previous page checkout_payment. I’ve been going over all the code looking for where it might be doubled. Any suggestions would be greatly appreciated. I’ve already scoured the checkout_confirmation page.
Hello Gary.
Thank you for yet another great contrib…
I just installed this last night, and happened to come across the same issue as Gerald above. By chance, what are the 4 sessions that need to be unregistered during logoff, in the event that the customer does not finalize the transaction?
Thanks.
-Rob
Rob
There are 4 or 5 tep_session_unregisters somwhere in the code in checkout_process.php. As well, add them underneath the other unregisters in logoff.php
leslie – suggest to uninstall and reinstall.
Gary
Just found your fix for PayPal’s IPN 2.3.3 issue. Your the man!
Regards, Edward
Please use the support thread at the official osCommerce Forum:
http://forums.oscommerce.com/index.php?showtopic=327653
Thanks.