Simple Promo Code Plugin

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.

 

The following two tabs change content below.

Peter

Web Developer at Silver Maple Web
Peter is a partner and Web Designer and Developer on Silver Maple Web. Peter has been building websites since 1996. Currently working in WordPress, Joomla! and Ruby on Rails. He has design experience and programming expertise in PHP, Ruby, Java, APL, HTML, CSS, and Javascript.

Latest posts by Peter (see all)

11 thoughts on “Simple Promo Code Plugin

  1. 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!!

  2. 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=

  3. 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.

  4. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *