I recently released the WordPress plugin, “Simple Promo Code”. This plugin provides a short code that allows a user ro enter a promo code to access a page or document. The form validates the promo code and tracks its usage. This can be very useful for tracking access to a document that you are promoting in an email campaign or magazine.
Use of the plugin is described on the Simple Promo Code page.
Like my other “Simple” plugins it’s well commented and was built with use as an example in mind. Feel free to pick it up and modify it to your requirements. I will be posting an annotated version of the code as a tutorial in the near future. In particular this plugin provides a small example of an HTML form that performs validation, updates a database and redirects the user to another page when complete.
pkw
Latest posts by pkw (see all)
- Enabling HTTPS in WordPress - May 26, 2017
- WordPress Maintenance for Beginners - March 28, 2017
- Five Top Mistakes of DIY Websites - February 11, 2017
How would I adjust the code to allow for multiple codes and multiple download links? (one form, several documents with their corresponding codes)
Thank you!!
Thanks for your interest in Simple Promo Code.
That shouldn’t be too hard to do, the code is not big or complicated. The only trick is that you must process the results of the post in the init action so you can do the redirect. I’ll keep tho in mind as a possible enhancement,
You could of course just use separate short codes for each download.
Hello.
I’m wondering the same thing as Katie. I’d love to be able to have one shortcode, with multiple codes, and corresponding links. I’m not comfortable changing the code myself, but if you could do this I think it would be a very important step forward in this plugin’s usefulness to anyone wanting a ‘coupon code’ style of plugin that redirects the user to the appropriate sales page with the correct pricing on it.
Thanks in advance for considering it,
Alexander
“Katie April 27, 2012 at 8:50 pm
How would I adjust the code to allow for multiple codes and multiple download links? (one form, several documents with their corresponding codes)
Thank you!!”
That was asked in april 2012. No enhancements yet? :-/
Can you guide on how to do that? That would be something like
code1=
code2=
code3=
Hello. Thank you for the plugin – just what I was looking for.
One question, though – how would I go about if I wanted to save the e-mail addresses?
Thank you.
There is a table in the database called wp_s_promo_hits. It contains the promo_code, name, created_date and email.
Thank you!
contribution to the community
hi i have the same request as Katie , can you help ?
Hi Peter,
Thanks for building a great plugin! It does exactly what I need it to do!
Is there a way to do the following three things:
(1) Have the ‘Submit’ button sit on the same row as the input box?
I believe the following code does the trick, but I am proficient in coding and not sure how to apply those changes to your code:
(2) Make the ‘Code’ argument NOT case-sensitive (eg. entering “25OFF” or “25off” will both work)
(3) Remove the display (even to me as the administrator) of success statistics (eg. 1 downloads for ‘XXX’ and ‘XXX’)
Thank you.
where i will go for download this plugin
It’s in the WordPress plugin repository at https://wordpress.org/plugins/simple-promo-code/