This is my first editing experience with ZenCart, and I would really appreciate it if a few of you gurus out there would try applying this and give it a once-over to see if it's all done right. I don't really have time to do much support for this, I just did it because I needed it myself, and I wanted to share it with the community. So if anyone else out there gets the gumption to take this over, I'd be happy to let you.
Anyways, below is the official description (from the readme file)
The install files are attached.
##########################################
Password Protected Categories!
Current Version 1.0
Work so far done by Stevish
##########################################
This mod creates a new field for categories in the admin called "Password". When this field is left blank, nothing is changed from a basic install of ZC. When a password is entered, that category becomes locked, and neither the category nor any of its contained products (just in case someone gets a direct link to a product) can be viewed without the password.
Due to the use of the $_Session variable, this is based on a per-visit access. This also means that anyone who has the password, whether or not they have a user, can gain access to the locked category. If a visitor enters the correct password, and then logs in or registers, they will not have to re-enter the category password until their session expires.
This addon was designed with photographers (like my wife) in mind. It is perfectly suited for taking private pictures, putting them in a categore (say "Mike & Trish Wedding"), then password protecting them. You can then give Mike and Trish the password, and they can order prints right from your site, as well as handing out the password to all their family and friends so they can buy prints directly from you as well. All the while, no strangers browsing your site can even see what Mike and Trish look like without the password.
LIMITATIONS:
This is fairly simply done as I'm brand new to ZC. I tried to make sure I kept the code consistent with the rest, and as a result, multiple languages can be supported (though I only know english...). So because of my lack of knowledge and wanting to keep it simple, I ended up with the following limitations:
- The password is stored in plain text. This should not be too big a deal, because if someone is able to hack your database, and all they gain is access to "private" pictures (which they still have to pay for if they want them), there's really no harm done.
- Failed password attempts are not logged. Someone could sit at the site all day trying password after password until they get it right. And even if they try a million times, nobody will even know they were trying. Again, the amount of work this would take vs the "reward" is not very tempting even for the most desperate hackers.
- I wanted to add a little lock symbol next to the locked categories, but I never got around to it. I just don't see it being worth the work for me.
If anyone has the time/know-how to fix these limitations, or add more functionality, feel free to contact me (stevish [at] gmail [dot] com) with what is required and I will get this thing updated and give you credit. I also might just hand off the whole project to you if you are willing to take it on. I just don't think I'll have the time to provide support for this.
Bookmarks