Update: This is now a feature that’s built directly into the Software Licensing add-on for Easy Digital Downloads. It can be accessed in Downloads > Settings > Extensions > Software Licensing. From there check the box for “Disable Discount Codes on Renewals”.

Recently I had a question about Easy Digital Downloads – Software Licensing that I hadn’t thought about before. When offering a renewal discount, how can we prevent any additional discounts from being applied to the cart? You see, depending on the discount code someone has, you could be losing money if you offer a discount to renew a license, and then a discount code is used on top of that.

So here’s the quick snippet, and what it looks like on the front end:

function kfg_check_if_is_renewal( $return ) {

	if ( EDD()->session->get( 'edd_is_renewal' ) ) {
		edd_set_error( 'edd-discount-error', __( 'This discount is not valid with renewals.', 'edd' ) );
		return false;
	}

	return $return;

}
add_filter( 'edd_is_discount_valid', 'kfg_check_if_is_renewal', 99, 1 );

Then if a customer tries to apply a discount code, with a renewal, they’ll see the following:
Screen Shot 2015-04-07 at 11.04.01 PM

If you would like a single-file plugin for this, you can get it from the EDD Library.

Posted by Chris Klosowski

Chris Klosowski is the Director of Technology at Sandhills Development, LLC, creators of fine WordPress plugins, and ecommerce solutions.

65 Comments

  1. Unquestionably believe that which you said. Your favorite reason seemed to be on the internet
    the simplest thing to be aware of. I say to you,
    I definitely get irked while people consider worries
    that they just do not know about. You managed
    to hit the nail upon the top and defined out the whole thing without having side
    effect , people could take a signal. Will probably be back to get more.
    Thanks

    Reply

  2. It’s fantastic that you are getting ideas from this post as well as from our
    dialogue made at this place.

    My blog post – mpc-install.com

    Reply

  3. Real great visual appeal on this internet site, I’d value it 10.

    Here is my page … https://kebe.top/

    Reply

  4. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I
    get four e-mails with the same comment. Is there any way you can remove people from that
    service? Thanks a lot!

    Also visit my web site 918kiss 2 slot game

    Reply

  5. Thanks on your marvelous posting! I actually enjoyed reading it, you are a great author.

    I will remember to bookmark your blog and may come back in the foreseeable future.
    I want to encourage you continue your great posts, have a nice morning!

    Visit my site; http://www.craksracing.com/

    Reply

  6. I wanted to check up and let you know how considerably I valued discovering your web site today.

    We would consider it the honor to operate at my
    business office and be able to use the tips shared on your site and also
    be a part of visitors’ opinions like this. Should a position associated with guest
    author become on offer at your end, you should let me know.

    My web page :: kebe.top

    Reply

  7. I and my pals happened to be checking out the excellent helpful tips on your site while the sudden I got a terrible feeling I never
    expressed respect to the site owner for them.
    All of the people are already absolutely happy to learn all of them and have actually been enjoying these things.
    We appreciate you getting quite helpful and also for using this kind of nice issues millions of individuals are really needing to understand about.
    My very own sincere regret for not expressing gratitude to
    earlier.

    my web site :: http://www.craksracing.com

    Reply

  8. Its such as you read my mind! You seem to know a lot
    approximately this, such as you wrote the book
    in it or something. I think that you simply could do
    with a few percent to power the message home a
    bit, but other than that, this is fantastic blog.
    A fantastic read. I will definitely be back.

    Reply

  9. Wow, wonderful blog layout! How long have you been blogging
    for? you make blogging look easy. The overall look
    of your site is fantastic, let alone the content!

    Reply

  10. Excellent weblog right here! Also your site lots up very fast!
    What host are you the usage of? Can I get your associate hyperlink to your host?
    I want my web site loaded up as quickly as yours lol.

    Feel free to visit my website: Keto Premium Shot Reviews

    Reply

  11. I regard something truly interesting about your web site so
    I bookmarked.

    Review my web blog :: Kodo Detox Patch

    Reply

  12. I don’t even know how I ended up here, but
    I thought this post was good. I do not know who you are but certainly you are
    going to a famous blogger if you aren’t already 😉 Cheers!

    Reply

  13. I know this if off topic but I’m looking into starting my own weblog and was curious what all is needed to get set
    up? I’m assuming having a blog like yours would
    cost a pretty penny? I’m not very internet savvy so I’m not 100% sure.
    Any suggestions or advice would be greatly appreciated. Thanks

    Reply

  14. I’m extremely impressed with your writing skills and also with the layout on your weblog.
    Is this a paid theme or did you modify it yourself? Either way keep up the nice
    quality writing, it’s rare to see a great blog
    like this one nowadays.

    Reply

  15. Some genuinely interesting details you have written.Aided me a lot, just
    what I was looking for :D.

    Here is my page … Electro Hard

    Reply

  16. I value the blog article.Thanks Again. Much obliged.

    Reply

  17. Have you ever considered publishing an ebook or guest authoring
    on other sites? I have a blog centered on the same topics you discuss and would really like to have you share
    some stories/information. I know my readers would value your work.
    If you’re even remotely interested, feel free to shoot me an e mail.

    Reply

  18. Magnificent goods from you, man. I have understand your stuff previous to and you are just extremely great. I really like what you have acquired here, really like what you’re stating and the way in which you say it. You make it enjoyable and you still care for to keep it smart. I can not wait to read much more from you. This is really a tremendous website.
    energylandia

    Reply

  19. Thank you for the visit, thank you also have provided the information we really need, do not forget to share information and visit our page thank you. blockchain

    Reply

  20. chdap viagra viagra cheap cheapest – bolton viagra

    Reply

  21. prednisone without prescription 10mg prednisone pills – pharmacy cost of prednisone

    Reply

  22. stromectol 3 mg ivermectin for sale humans – stromectol covid

    Reply

  23. ivermectin human generic stromectol – buy stromectol

    Reply

  24. best male ed pills prescription drugs without doctor approval – buy prescription drugs without doctor

    Reply

  25. online medications natural ed remedies – medication for ed dysfunction

    Reply

  26. plaquenil 100 plaquenil for sale canada – plaquenil order online

    Reply

  27. order stromectol buy stromectol – ivermectin 18mg

    Reply

  28. clomid 50mg clomid for sale – clomid canada

    Reply

  29. do i need prescription for cialis in usa cialis pills – cheap cialis generic online

    Reply

  30. buy generic 100mg viagra online viagra – online doctor prescription for viagra

    Reply

  31. Hello, I enjoy reading through your article. I like to write a
    little comment to support you.

    Reply

  32. Very nice write-up. I absolutely appreciate this
    website. Keep it up!

    Reply

  33. Very nice article. I definitely love this
    site. Thanks!

    Reply

  34. Im thankful for the article post.Much thanks again. Much obliged.

    Reply

  35. cost of ivermectin medicine ivermectin for sale – ivermectin uk

    Reply

  36. I blog quite often and I truly appreciate your information. This article has really
    peaked my interest. I will take a note of your blog and keep checking
    for new details about once a week. I subscribed to your RSS feed too.

    Reply

  37. Howdy! Would you mind if I share your blog with my myspace group?
    There’s a lot of people that I think would really appreciate your content.
    Please let me know. Thanks

    Reply

  38. Woah! I’m really loving the template/theme of this website.
    It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between user friendliness and appearance.
    I must say you have done a great job with this.
    Additionally, the blog loads super quick for me on Safari.
    Outstanding Blog!

    Reply

  39. buy finasteride no rx propecia for sale – drug finasteride

    Reply

  40. You have made some decent points there. I looked on the net to find out more about
    the issue and found most people will go along with your views on this website.

    Reply

  41. I am truly happy to read this blog posts which includes
    plenty of useful data, thanks for providing such statistics.

    Reply

  42. online drugstore india pharmacy – ed online pharmacy

    Reply

  43. My spouse and I stumbled over here by a different website
    and thought I might check things out. I like what I see so now i am following
    you. Look forward to going over your web page
    yet again.

    Reply

  44. mexican viagra viagra cost per pill – where to buy viagra

    Reply

  45. cheap pills online india pharmacy mail order – over the counter erectile dysfunction pills

    Reply

  46. Hi I am so thrilled I found your web site, I really found you by mistake, while I was browsing on Aol for something else, Nonetheless I am here now and would just like to say cheers for a marvelous
    post and a all round interesting blog (I also love the theme/design), I don’t have
    time to read through it all at the minute but I have book-marked it and also
    added in your RSS feeds, so when I have time
    I will be back to read a lot more, Please do keep up the excellent b.
    quest bars http://bit.ly/3C2tkMR quest bars

    Reply

  47. non prescription ed pills trusted india online pharmacies – buy ed drugs

    Reply

  48. Spot on with this write-up, I absolutely believe
    that this web site needs far more attention. I’ll probably be returning to read more, thanks for the
    advice! asmr https://app.gumroad.com/asmr2021/p/best-asmr-online asmr

    Reply

  49. ivermectin new zealand ivermectin – ivermectin eye drops

    Reply

  50. Hey there! I simply want to offer you a big thumbs up for your excellent information you have right here on this post.
    I will be coming back to your website for more soon. cheap flights http://1704milesapart.tumblr.com/ cheap
    flights

    Reply

  51. Valuable information. Fortunate me I discovered your website accidentally, and I’m shocked why this
    coincidence didn’t happened in advance! I bookmarked it.

    scoliosis surgery https://0401mm.tumblr.com/ scoliosis surgery

    Reply

  52. Hey there, You have done an excellent job.
    I will certainly digg it and personally recommend to my friends.

    I am confident they’ll be benefited from this web site.
    quest bars https://www.iherb.com/search?kw=quest%20bars quest bars

    Reply

  53. Howdy! I know this is kind of off topic but I was wondering if you knew
    where I could locate a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having difficulty finding one?
    Thanks a lot! scoliosis surgery https://coub.com/stories/962966-scoliosis-surgery scoliosis
    surgery

    Reply

  54. Simply want to say your article is as surprising. The clearness in your post is just great and i could assume you’re an expert
    on this subject. Fine with your permission allow me
    to grab your feed to keep up to date with forthcoming post.
    Thanks a million and please keep up the rewarding
    work. ps4 https://bitly.com/3nkdKIi ps4

    Reply

  55. ivermectin buy ivermectin – ivermectin 1 topical cream

    Reply

  56. prescription drugs without doctor approval treatment with drugs – male enhancement pills

    Reply

  57. pain meds without written prescription mens erections – ed meds

    Reply

Leave a reply

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