Totally Zenned
- Join Date:
- Oct 2008
- Location:
- Croatia
- Posts:
- 1,808
- Plugin Contributions:
- 22
Database approach for additional images
Perhaps this get more exposure here than it did on github...
I've been trying to come up with an explanation as to why Zen Cart still uses the ancient directory scanning method for additional images, instead of holding that data in the database. Since most (if not all) other modern platforms use the database driven approach, I can't help but wonder if they're all wrong and only Zen Cart knows what's good... :shocking:
The approach I'm suggesting would make things sooooo much simpler for the end user because additional images could easily be added while creating a product or updating it, without the need to navigate away to use Image Handler. Of course, IH could still be used for optimizing images (although this also needs a new modern approach, but that's a different story).
It also eliminates the need to follow exact naming conventions, meaning you could easily have "product.jpg" as main image and "different_view.jpg" and "another_view.png" as additional images (notice the different extension!)...
It would also allow template creators to have a rollover image with a simple lookup instead of scanning the entire images directory let's say 12 times on a product listing page with 12 products...
And, as I had already mentioned on Github, incoming supplier feeds would no longer be a nightmare to handle.
A few screenshots are below...
**Anyone interested to test it out, or perhaps any interest of getting it into core code? **
If anyone wants to give it a try, please PM me for a zip file. I've also included a converter file so any existing products with additional images can automatically populate the database and start using this approach.
Create product:
My site - Pro ZC Help
My portfolio | My plugins