1 Attachment(s)
Password Protected Categories (PPC) - Support Thread
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.
Re: Password Protected Categories (PPC) - Official Thread
Thank you so much for this contribution. Installed and works flawless with hideCategories mod (just in case someone stumbles upon the hidden category or product).
Re: Password Protected Categories (PPC) - Official Thread
Quote:
Originally Posted by
kachana
Thank you so much for this contribution. Installed and works flawless with hideCategories mod (just in case someone stumbles upon the hidden category or product).
Good! I'm glad to hear there's no conflicts with that mod as they'll probably be used together a lot.
Re: Password Protected Categories (PPC) - Official Thread
Hi there, this sounds very promising for a site I'm setting up. how does this perform in connection with the search function? Does the 'hide categories' deal with keeping them out of that?
Re: Password Protected Categories (PPC) - Official Thread
Actually i've just read that it can be hidden from the search with the other mod. In which case I think I better get cracking! Thanks for posting this btw, it will come in very handy for building a trade section to my clients site.
Re: Password Protected Categories (PPC) - Official Thread
Quote:
Originally Posted by
Noncents
Hi there, this sounds very promising for a site I'm setting up. how does this perform in connection with the search function? Does the 'hide categories' deal with keeping them out of that?
Thanks for the comment, I need to edit this to make it so it will lock people out from searches as well... though I'm not sure how I will do that. I guess the current fix is to use the "Hide Categories" mod along with this one.
Re: Password Protected Categories (PPC) - Official Thread
I'm trying to install your mod, but can not find some of the directories you say need to be modified.
/includes/languages/english/CUSTOM/index.php
/includes/languages/english/CUSTOM/product_info.php
/includes/templates/CUSTOM/templates/tpl_index_product_list.php
/includes/templates/CUSTOM/templates/tpl_product_info_display.php
It appears I do not have a CUSTOM folder in my install. Is the mod version specific or am I missing something?
Any help would be greatly appreciated!!
Re: Password Protected Categories (PPC) - Official Thread
Ok I'm stupid....
I cannot find some of the lines to change
/includes/languages/english/CUSTOM/index.php
-->define('TEXT_PRODUCT_MODEL', 'Model: ');
/includes/languages/english/CUSTOM/product_info.php
-->define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');
I cannot find the following files
/includes/templates/CUSTOM/templates/tpl_index_product_list.php
/includes/templates/CUSTOM/templates/tpl_product_info_display.php
Am I missing something?
Any help would be greatly appreciated!!
Re: Password Protected Categories (PPC) - Official Thread
Ok, I found the files but when I go to categories, I can't add a new category. I don't have the option to add anything...
Re: Password Protected Categories (PPC) - Official Thread
Quote:
Originally Posted by
robbinsgj
Ok, I found the files but when I go to categories, I can't add a new category. I don't have the option to add anything...
Zen cart will only add categories if there are no products in that category. So if you've added products in the "root" category, you may have to delete them and add some categories instead... I'm not really sure if there's an easier way to do that.