PayPal Promo Code Plugin

The PayPal PromoCode plugin allows you to create custom promotion or promo codes for your PayPal Buttons and also to create the PayPal buttons you need, to add Buy Now or Pay Now items to your posts or pages. Note: to use the promo code feature, the buttons must be created using plugin in order for PromoCodes to work with them.

PayPal PromoCode allows you to easily add your buttons to a Post or a Page by using a place-holder code ( for example [pppromo=1] ). Just place the code in the post or page where you want it to display and you are good to go. You can add as many buttons to a page/post as you want, including adding the same button multiple times (like at the top and bottom of a long page).

PromoCodes can be used two ways, either by telling the customer to use PromoCode YourCodeName (this would be whatever name you give it) or by adding the & or ? and pppcode=YourCodeName to the end of the url you give customers linking to a specific item or your home page. For example: http://donfischer.com/?pppcode=YourCodeName would take them to the home page of the site and set the PromoCode session. Now when they visit any page that has a PayPal PromoCode button on it, the promo code will be automatically applied – no need for the customer to type it in (this works great for hyperlinks and links in emails).

PromoCodes are not case sensitive. You can add as many promo codes as you want for each button / item or make a global promo code that affects all items (i.e., 10% off, or $3 off each item)

This plugin also has PayPal Instant Payment Notification integrated into it and will save all transactions to a database after completion for later retrieval (NOTE: NO reporting is included at this time – but the data is there for later updates/upgrades).

NOTE: Before you Upgrade to 1.4.7, Deactivate any prior version. Delete the files, then install the new one. If you do not, the plugin will probably fail. All settings and buttons will remain intact.

Tested: WordPress v2.5 – v3.1 alpha
Current Plugin Version: 1.4.7
Version Control:

1.4.7: Fix Button selection and Database Upgrade Fix. jQuery update  (functionality).
1.4.6: Fix Bug where promocode would apply to multiple buttons on a page. (functionality).
1.4.5: Fixed ppdiscount Column in PCode database to be Decimal(10,2) – BIGINT(20) Was rounding  (functionality).
Fixed Display Message problems (functionality).
1.4.4: Added jQuery for button selection and additional types of buttons (enhancement/cosmetic).
1.4.3: Fix to database update function (functionality).
1.4.2: Added Shipping Amount box (enhancement).
1.4.1: Fixed a few minor bugs for use in PHP4 (functionality).
1.4: Fixed Version Check (cosmetic).
1.3: Fixed Content Filter function – was printing out button prematurely and was not compatible with other themes or plugins that used content filter (functionality).
1.2: Fixed Add Promo bug where button list not correct. Added UI Text for Add Promocode page. Updated text on Add Button Page (functionality).
1.1: Added instant payment notification for PayPal. Fixed DB Data Type for Amount in Button DB Table.
1.0: Initial plugin Release



Test Buttons (Created with this plugin):
Please Note – These are Working buttons – so please do not complete checkout unless you want to be out the price of the test.
Valid Promo Codes to use for test are 5OFF, JULYSPECIAL, and TESTING

Test Buy Style Button
Price: $5.00
Shipping: $2.00
Promo Code (optional)

Test Cart Button
Price: $5.00
Shipping: $2.00
Promo Code (optional)

Test Pay Now Button
Price: $5.50
Promo Code (optional)

Test Buy Standard Button
Price: $7.00
Promo Code (optional)

Screenshots:



56 Responses to “PayPal Promo Code Plugin”

  1. Frank says:

    I was wondering if there is an option to have a drop down list to add different qty and price to this plug-in. Allowing discount codes only for items that you pick from the list.

    Also i am having issues, when i pick “add to cart” button to be the bottom type it will not set it as this. It always changes it to the big “Pay Pal Buy Now” button. Is this a known issue or am i missing something?

    Thx
    Frank

    • dfischer says:

      Frank – no, there is not an option for a dropdown. The plugin could probably be modified to allow it with a little knowledge of php and PayPal buttons it would not be that hard. Unfortunately I’m not able to jump into that right now as I have a large plate of projects to contend with at the moment.

      I am not aware of any issue with the add to cart buttons, but if you have an example so I can see it to try to re-create the issue, I’ll be glad to see if I can find the problem.

      Regards – Don

      • Frank says:

        There is no example i could show you unless we did a GoTo. When I create a button it will not save the button as “add to cart” I will click edit after apply to make sure the changes saved and it puts the but right back to Pay Pal Buy now. I also had to go in an modify the PHP file “paypalpromo” to actually even show the buttons in the “add button” options section. In the code it was pointing to: “/paypal-promocode-custom/buttons/paymentButton-cart.gif” But when i installed the plug-in all the buttons were located here: “/paypal-promocode/buttons/paymentButton-cart.gif”. Could this be part of the issue? Maybe i missed somthing that i need to modify.

        • dfischer says:

          Got it. I figured out the problem. I uploaded a fix early this morning – 1.4.7

          Download it, delete the old one completely and install the new one. Your settings will be retained.

          Let me know if that fixes the problem for you.
          Regards – Don

          • Frank says:

            Thnx

            I will give it a shot and let you know if i come across any other issues.

            Frank

            • Frank says:

              Is there anyway to turn off rounding. For example I want to either set a price of an item to $3.50 from 4 or discount it by .5. I have tried both ways and the Promo code changes to $4 on the set price and round up to $1 when trying discount rate. I was also wondering if there is any type of option to add a Referral field. (Free form text to enter a referral ID to track who referred the buyer to the site).

  2. TV Stands says:

    Wow, you don’t often hear Paypal and discount / voucher in the same sentence.

  3. Christine says:

    When using the %off, the price is coming out $7.9 instead of $7.90, do you know how to get the zero to display?

    Thanks!

    • dfischer says:

      Christine –
      That would probably involve editing the plugin to display the correct format.
      It may work OK in the new version. I am uploading it now so people can start downloading if they desire – it fixes a lot of older problems and adds some new functionality. Let me know if it does not resolve the issue.

      Regards, Don

      • Christine says:

        Hi Don,

        Thanks for the response. The new version did fix the rounding issue.

        I have a new issue. I’ve added some new buttons and am up to 13. It seems that buttons up to 9 work, but 10-13 don’t seem to show the coupon code form. Is there a reason why 10 and above aren’t working?

        Thanks for the help,
        Christine

  4. Brian G says:

    One thing that is kind of important, which I hope you will implement in a future version, is limiting a person to 1 or a set number of coupon code uses. Since the person is paying through paypal, and providing name, address, and other information, I hope it will be easy for you to track the coupon usage.

    And while I’m asking for things… it would be great if there was a 100% off option that simply sent an email to the site admin (or other email address) that a freebie coupon had been redeemed.

    Very nice so far.

    • dfischer says:

      Thanks. I do have plans for a few additional features in the future, I just have not had the time to implement anything new. I DO have a new version that fixes a few issues and adds the ability to add a cart and cart buttons – as well as additional product meta to be displayed. I have not released it here yet, because I am still testing – but if you (or anyone) would like to try it out, please shoot me an email and I’ll get you a copy.
      Regards – Don

      • Brian G says:

        Don,

        Since I don’t need that functionality, I’m going to pass on your offer to test out the newest version. I do appreciate the work you are doing, and I too am a developer of free software (just not really all that familiar with WordPress).

        I’ve got an e-commerce solution that is built on the latest CodeIgniter framework. If you are interested, the project is in the CI Wiki, and the repository is on Bitbucket. Name of the application is “Community Cart”.

        Take care – Brian

      • Phil says:

        Hi Don,

        I would like to try the new version that with shopping car function. Just a quick question for you..can I run this without wordpress?

        Many thanks,

        Phil

  5. bart says:

    I have solved the issue, I just added a line in the paypalpromo.php to add a per item shipping (beyond the first item) using the shipping2 variable and the issue has been resolved. Sorry to have bothered you. The plugin is amazing made my life so much easier. Great work!

  6. bart says:

    Before I ask my questions just want to say this plugin is great, it made my life so much simpler, great job. I want to apply a per item shipping cost, but it seems that when I put the shipping in using the plug-in it only charges shipping for one item no matter how many have been ordered. I set up shipping methods using paypal but I am still unable to get it to acknowledge. Any info on this would be greatly appreciated.

  7. Ozzie Saunds says:

    Hi Don,

    After a customer uses a promo code will that promo code that they used when purchasing be shown on the paypal receipt? Basically will I be notified of the promo code being used, if using multiple promo codes? In order to do this do I have to modify the plugin?

    Thanks,
    Ozzie

    • dfischer says:

      Ozzie –
      There is a variable that is passed to PayPal in the button called ‘custom’ that contains the promocode and the button url. depending on how you have your PayPal account set up, it may be possible to retrieve that data.

      You could also modify the plugin to append the title of the item to include the promocode if one is present to be sure session and ensure that PayPal retains it, but that would require a bit of knowledge of PHP to modify it.

  8. Wesley says:

    Hello,
    Very nice work on this plugin!
    I made a slight modification that I wanted to tell you about.
    I appended the variable $procodesession to the item name being passed to paypal so that I can keep track of which codes are being used.

    Cheers!

    • dfischer says:

      Thanks, and glad you like it! That is a very good idea.
      Regards – Don

    • Ozzie Saunds says:

      Question, what modification can be made to allow paypal to keep track of the promo codes being used.

      Can I get more details on appending the variable $procodesession

      Thanks,
      Ozzie

      • dfischer says:

        The $procodesession is created on or about line 111 of the plugin. This could be modified if desired to include another variable like the button number and the promocode number to set different sessions for each code. To do that, you would probably also need to add another hidden input field to the promocode box form on or about line 268 (ie. ) then read that variable when you create the session.

        I don’t really provide support for this plugin any longer as I have plans sometime this year to create a new version of it – but I will try to help out in any way I can.
        Regards – Don

  9. Dan says:

    Hi Don,
    Thanks for this excellent plugin!

    I like that your plugin support multiple currencies but this only works when transmitting parameters to PayPal. It doesn’t actually change the currency symbol displayed on the page.

    I have taken the liberty of modifying the code to replace $ with £ and have also modified the Buy Now button URL from the US to the GB one.

    Making the above dynamic would make the plugin absolutely perfect!

    Just thought I’d share the experience for someone outside of the US.

    Dan

  10. Hi, your plugin looks great! yet when I downloaded it I received only two .php files, when I open them in a browser I get all the code, when I open them through windows explorer they open in my default for php which is dreamweaver and is, of course, still the code. What environment am I supposed to open them in to see the interface? Or is there a glitch in the download?

    Thanks, I am really looking forward to trying it.

    Terese

    • dfischer says:

      Terese,
      The plugin is only for the WordPress platform. You need to have a website running WordPress, then you can place it in the plugin directory and activate it – getting access to all of the functionality. It will not work any other way.
      Regards – Don

      • thank you for your swift response!

        okay, well that was next on my list anyway! Can you then use the promo code on any page within your site? Like special pages that are linked elswhere etc

        I am assuming you are speaking of a self hosted wordpress platform, is that correct?

        • dfischer says:

          Therese,
          Yes, a WordPress stand alone site.
          You can use it on any page that has access to the WP core files, so if you create a page or a post from within the WordPress site itself, you will have access to the Plugin functionality. Hope that makes sense.
          Regards – Don

          • what if I already have a site built and want to integrate wordpress, does that work? or does it need to begin as a wordpress site? Plus I have a database for products, that would pose no problem right? though I believe some promos will require pages made specifically for them…

            • dfischer says:

              Terese,
              Let me clarify a few things for you:
              1. The plugin will only work for pages or posts created in WordPress, or converted to WordPress. If you have a site already built, it would have to be ‘ported’ to WP in order to make it work.
              2. In order for the promo codes to actually work, the products (or buttons) need to be created from within the WordPress admin area – otherwise you can’t associate then with a promo code or discount.
              3. If you already have a database of products, this may not be the plugin for you. As I stated, the product buttons would need to be created from the admin area of WP to make them work – meaning you would need to re-create everything you have.

              Probably the best thing for you to do, is set up a WordPress install, add the plugin, and then play around with it to see if it is something that would be beneficial to you or not.

              The way the plugin is designed, you can’t use existing buttons or hosted PayPal buttons, as the code needs to calculate the appropriate discount based on the code. At the time the plugin was written several years ago, PayPal did not allow API access to the buttons, so the scripting was limited. Today, however, that allow greater access to all areas of your account, including hosted buttons, so it may be possible in the future, to tie into that API and eliminate the need to have the button created in the plugin alone. With that said, in order to do that, the plugin would have to be totally re-written – and that is not something I have the time or resources to do anytime soon.

              Since I am getting many requests for features that could now be added because the API allows, I am planning a new release sometime in the summer of 2010.
              I hope this helps answer some of your questions.
              Many regards – Don

              • Thank you Don! You’re terrific and very kind to take such time with me. Good luck in all your endeavors, I will be playing with wordpress and the plug in this week.

                Thanks again, T.

  11. bella says:

    I am currently using a simple paypal shopping cart to sell 1 product. However, I’d like to add the capability to offer promotional pricing for multiple purchases. For instance, 20% off your total purchase when you buy 2 or more books.

    Will your plugin allow for this? If so, where will the customer be able to enter their purchase quantity? Thanks in advance for your help!

    • dfischer says:

      Tamika –
      Unfortunately, there is no capability to do tiered discounts. I do have plans to add them sometime in the future, but that will be a bit further down the road, as there don’t seem to be enough hours in the day to complete all the projects I currently have ongoing. Check back every once in a while to see if there is an upgrade. Eventually, I will be releasing it into the WordPress repository to make it easier to upgrade as well.
      Regards – Don

  12. Brent says:

    Hi Don,

    Did my question get deleted?

    Brent

    • dfischer says:

      Brent – no, it just needed to be moderated.
      Thank you for the comment. Right now, there is no functionality to do a tiered discount structure. It is basically a simple promo code structure, like X% off a specific product or Y% off all products, etc.

      I created the plugin several years ago, and the PayPal API has come a long way since then, so there is the ability to do a lot more than what was previously allowed. I have plans to re-design the plugin with new features and a cleaner interface, but I am not quite sure when that will happen. Maybe a few months from now.

      Regards,
      Don

  13. Brent says:

    Hi Don,

    This very well could be one of the best plugins out there!

    I’m wondering will it do the following:
    10% OFF 2 items
    15% OFF 3 OR MORE items

    Thank you!

    Brent

  14. jess says:

    hi
    i am trying to add disc code to our live site. we have customers (eek!) waiting & want to give them a discount. the majority are college students ;-) can u help? been on phone w/reps outside of country & are getting no where fast….
    thanks
    j

  15. I love to read articles that are informative, Thanks again for a nice site

  16. Jocelyn says:

    Hi – I am trying to use this for a subscription (vs a buy it now)

    Is there any way to make this work? Thanks

    • dfischer says:

      Jocelyn –
      It is not really set up for subscriptions at this point, but I suppose if you are moderately good at editing in PHP, you could change it slightly to allow that. I think you mainly would just need to change the ‘cmd’ input tag value from ‘_xclick’ to ‘_xclick-subscriptions’ and then change the button image to get it to work that way. If you need help, let me know.
      Best regards – Don

  17. Sandra says:

    Don,
    Thank you so much for helping me out….your response was super fast! Your plugin is great….very easy to use. I literally spent all day playing around with code (I’m not a programmer), trying to figure out how to add coupon codes to my site until I finally stumbled onto your pluggin….Thanks so much for everything.

    Sandra

  18. Sandra says:

    Has anyone tried this plugin with WP version 2.8.5?….I’m having problems….Help!

    Sandra

  19. Damon says:

    Don,

    Thanks again….everything works like a charm! Can’t wait until your next major upgrade.

  20. Damon says:

    Don,

    Thank you for the quick reply. Now I can hardly wait until the upgrade….lol. Sounds great!

    I appreciate any tweeks that you can do until then since, if I am correct in my thinking, the issue is at the button level in the code generated, of course, when the promo code is applied and the plugin goes back to the original button to create the discount page and button with the discount applied. Much more clear in my head than in translation…lol.

    What I did for my immediate customer that I was trying to use your plugin for, was to just lower the price in the plugin to the discounted amount so that she would not have to enter the promo code. I then created the post with the html data for your button instead of just using the [pppromo=1] so that I could add the shipping lines of paypal code. In effect just straight coded instead of using the plugin directly, although the promo option was still visible because I pulled the code from your plugin. ( I kind of liked that look, so I kept it in).

    The trouble with this obviously being that anyone can get this discounted price without having to know the code so I will have to delete this post after she completes her purchase.

    • dfischer says:

      Damon,
      I added a shipping amount box for the button creation/edit. It will add the shipping amount option that I think you need. Remember to have the Require Shipping Address box checked as well.

  21. Damon says:

    While waiting for your reply, I decided to play around a little with your plugin to see if I could just do a little more of the work to get it to do what I needed for my physical product that requires a shipping fee to be added to the total.

    In order to get my shipping rate in your plugin, I viewed the source after adding your [pppromo=1] code so I could see your actual code for this.

    This allowed me to use the raw code as I suggested in my preceding comment instead of your [pppromo=1] code by simply copying the paypal part from the source code and pasting that into my post.

    I then added the shipping code lines that paypal needs to add my shipping rate to the total and it worked fine if the payment button was clicked with no promocode. My shipping rate was there on the final paypal purchase page.

    However, if promocode was entered, the shipping amounts were omitted after the discount was applied when clicking the new discount payment button from the discount page. Paypal would complete the sale without charging shipping.

    So obviously, by now viewing the source on the discount page, the payment button that is made for the discounted price and applied to the new page pulls its creation from the ppbtn”x” list from the plugin defeats what I am trying to do.

    This is the problem that I am having with the plugin.

    • dfischer says:

      Damon –
      Thanks for the comments on the plugin!
      The easiest way to get the shipping applied to all buttons is it set up general shipping rules in PayPal itself. If you are looking for various shipping rates that are not consistent across the board, that would not work, however.

      the plugin was written several years ago and is in need of a dire upgrade. I have plans to do a major upgrade to the plugin later this year – hopefully next month to make the Christmas shopping season. Future upgrades plans include a wider range of buttons, a subscription feature, a donation feature and some enhancements to the promo code features – like limited number of use (first 50 people to use it, for example). But until that point there are many limitations.

      Let me see what I can do for you individually to make the shipping work the way you need it.

      Don

  22. Damon says:

    Also, is it possible to have the plugin provide the html as an alternative for insertion instead of just the [pppromo=1] etc.?

    Wouldn’t this allow the insertion of additional paypal features by the user if necessary, such as the shipping code?

  23. Damon says:

    I love your plugin, but would like to request the ability to add a shipping amount to the product button. I see a check box for shipping required, but do no see what it does.

    When tested, the promocode worked beautifully, but did not allow me to include appropriate shipping fees for a tangible product.

    Thanks,
    Damon

  24. vince says:

    great! it’s all working now.. thanks a lot.

  25. dfischer says:

    I updated a few things. Please let me know if you are still having problems. – DON

  26. vince says:

    this is a very nice plugin.. but I have a problem.. i made my own sales page and i want to add this plugin to my sales page. How can i do that? pls help. tnx :)

Leave a Reply