I have a free download product (using Easy Digital Downloads) right now that some users don’t realize they can simply download again from their dashboard. That’s fine if you let them buy it multiple times I guess, but it’s unnecessary in my case, and so it’s showing multiple “sales” from the same person for the same file.
Special thanks to Scott Deluzio for having crafted the majority of this lil’ snippet to modify the behavior of Easy Digital Downloads to stop multiple checkouts. He has two snippets on his page, one to add a nag message if the item has been previously purchased, and one to simply turn off the checkout function (but no message). I thought it would be a better user experience to do both so that the customer knows why they can’t checkout. Perhaps he meant them to both be added, but the codes were so similar I just decided to smush them together rather than waste the bits.
To modify the original code from Scott, I changed the function name from his nag message code to match the prevent checkout code. I also added a variable to pull the name of download in question to add to the nag message so that customers would know exactly which download was causing the issue.
He also has some sample code to try with multiple downloads but as I don’t have a need for that at this time I haven’t tested it. I’ll update the post once I do.