Cartweaver Mod: multiple product images, auto photo resizing, mouseover js display

A very nice CartWeaver user contacted me for some help with her product images - basically, she wanted to add more images per product (easier than ever in CW3) and, most importantly, she wanted a way to let her clients upload a single image, and have the thumbnails and other sizes made automatically.

I set up a demo version of the add-on, saving a copy of the modified CW code so I can use it again for my own clients. ( That link shows a default product page with a very basic multiple image javascript display... in theory, the finished product would be much nicer. A demo of the admin is here ( use admin/admin to log in)

I added an automatic uploader / image resizer, and set up her images table in the CartWeaver database to handle 5 images for each product, with 4 sizes for tiny preview, details thumbnail, large image, and zoom.

In the CartWeaver admin, she simply uploads a single image file for each photo slot, and the thumbnails are made on the server (instead of a separate upload slot for each image size). Otherwise, it works and looks exactly like the regular CartWeaver admin.

On the display side, the single results page composes the mouseover image swap display for 1 to 5 mages, whatever is available.

The way this code works, any number of images and any number of sizes for each can be used - and any type of gallery, lightbox, list or display of the images can be populated from the image query.

Updated spring 2008: Now using CFimage for super fast, high quality resizing on the fly with more accurate height/width scaling.

The resizer works with both tall and wide images, with a maximum width and height set in the database for each size of image.

Each image upload slot can have its own set of sizes and max w/h dimensions, so the possibilities are almost endless.

The CW site I was working on was on a CF7 server, so instead of using the onboard CFimage functions in CF8, I went with Massimo Foti's tmt_img.cfc  - so in theory it should work on any server, running any recent version of ColdFusion.

Contact me directly to log in and test the admin on that demo site, or if you are interested in using this code on your own CartWeaver (or other) sites.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Maybe something like this will be built into CW4?

Either way, I think something like this is a necessity for any site.
# Author Barry Morrison | 9/5/07 3:27 PM
Hi Michael, can you please contact me regarding implementing the image size on upload feature for Cartweaver? Thanks.
# Author Marek | 11/14/07 3:42 PM
That's a great idea! You might want to create a pop-up window to auto-fit the image so it doesn't pop over the website in tab mode if someone has tab option on. But other than that, it's very nice.
# Author Joe | 1/9/08 1:49 AM
UPDATE: added more info and an actual CW Admin demo so you can see the mod in action
# Author Miichael Evangelista | 1/29/08 10:33 PM
The demo store login details are not working...any chance of resetting them? ;-)
# Author Brendon | 7/30/08 7:01 AM
The demo is intentionally *not* using an open log in.
Hence that last line in the post "contact me... "
(feel free to!)
# Author Michael Evangelista | 7/31/08 11:45 PM
blogcfc 5.9.1.002 by raymond camden
contact michael evangelista