View Full Version : "Coupon Code" Plugin Improvement

Alexandre Ono
June 3, 2013, 05:21 PM
I would like to suggest some improvement in “Coupon Code” Plugin. I would like to visualize Who, When, How and How Much coupons are used. Something like that:

User / coupon code / plan / Discount / date
User A / 123456 / Silver / 10% / 05-02-2013
User B / 456125 / Gold / 20% / 10-05-2013


Steffen Buschkemper
June 3, 2013, 09:56 PM
Hello Alexandre Ono,

There are several possibilities to realize this.
The easiest would be to modify something the Coupon Plugin, because the database table for this is partly already available.
It would have "only" some modification and to be created a table in the admin panel.

Another option would be to insert it into the transactions table. Admin panel -> Common -> Transactions.
In my opinion this would be a better option. However it requires for this some modifications in the Flynax Classified script.

Let me know which possibility you want to use and i try to help them.

Best regards

Alexandre Ono
June 4, 2013, 12:22 AM
Hi Steffen,
Thanks for your attention.
I don't know exactly the best solution for this implementation. I don't have experience with programming, but I will appreciate if you help me in this work.
Best regards,

Steffen Buschkemper
June 4, 2013, 12:41 AM
Hallo Alexandre,

I will test this and post a solution here.
But I need a few more details.
What kind of payment gateways do you use?
It must be also made modifications there.

Best regards

Alexandre Ono
June 4, 2013, 02:00 AM
Hello Steffen,
Now I'm using PayPal, but in the near future I intend to use a Brazilian payment gateway (I have to do some customization for that).
Once again, thank you for your help!
Best regards,

Steffen Buschkemper
June 5, 2013, 12:04 AM
Hallo Alexandre Ono and all who need this feature,

I have decided to insert this feature in the transactions table.
It makes more sense as a separate table.

This feature will show you used coupon code inclusive the discount of a transaction.
The discount is shown in brackets as A or P.
P = discount in percent
A = discount amount

Please note this feature will only work with installed coupon plugin!

Now here comes the solution.

Part 1

Login into the Admin Panel and go to Common -> Database
Paste the follow SQL query

ALTER TABLE `{sql_prefix}transactions` ADD `Coupon` VARCHAR(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '-' AFTER `Txn_ID`

and press the button "Go".

Part 2

NOTICE: Please back up all files before change!

Download and extract the 536.
The folder structure in the zip file is the same as @ your ftp root.
You must only replace the files in the folders via ftp in their folder in the root directory.

Thats all. :rolleyes:

Now you can see coupon code including discount in the transactions table. See picture...



INFO! I modified only paypal and 2co payment gateway for this feature.
Every who wants this feature also for other paymant gateways report it here in this thread and i will help you.

Best regards

Alexandre Ono
June 5, 2013, 04:26 AM
Hi Steffen!!!
Thaks a lot!! Outstanding work!! Congratulation!

Steffen Buschkemper
June 5, 2013, 04:31 AM
No problem.
You're welcome! ;)

It was a good idea from you.
This is also useful. Now we know - who has used what code.

Morgan Bohman
June 5, 2013, 04:58 AM
Great Steffen! Thanks a lot, I'll install tonight and good idea from the beginning!


Fabio Zalpa
November 20, 2014, 12:41 AM
I need a help. I'm using pagseguro plugin and I tried many things to get used coupon code with that gateway. Any idea how to link transaction with used coupon code?


November 20, 2014, 03:49 AM
Hello Fabio,

Would you please keep the discussion of the issue in the corresponding ticket.