Hi,
I have a question about product images, is it possible to replace jpg or gif with swf in each product image?
Thanks
Hi,
I have a question about product images, is it possible to replace jpg or gif with swf in each product image?
Thanks
yes, it definitely is. but it does take/is taking some creative coding, including a database workaround. there's an easy way and a hard/correct way:
Here's my understanding (and I'm a weak php programmer): whenever you see an image in zencart, it is often called from the same file, located in YOURSTORE/includes/templates/template_default/templates/tpl_modules_main_product _image.php. This file calls all the database data regarding the filename for the photo, and your product display files call this file and the photo data to display the picture on the site.
When you see a products image on the display page, it's URL is being called from the database into the tpl_modules_main_product_image.php file by whatever filename and location you gave it when you uploaded the photo to the catalog. If you go to the Admin Products section and manually type in the path of the .swf file that you want, the database will call the .swf file as the image. So yes, it is possible to have a .swf in place of your product image, and fairly easily.
Now here's the tricky part. You have to modify your tpl_modules_main_product_image.php file to echo the proper flash movie embedding code, then call your variable (in this case, $products_image) within the code. (If you want more information on this, just post or PM me and I'll try to help you out.)
If you correctly modify the file to read your .swf file locations and properly embed them in the product display, you're all set - the easy way. Remember, Zen Cart uses the same file to call your image in a number of different places, including thumbnails in category view, in the Featured and New products, etc. etc. I assume you still want a picture to appear in those other places - you just want the .swf on the product display page.
That's where I am at present. My next steps are to create a new column in my products table in the database, write the proper functions, variables in my language files, etc. to properly call it.
If/when I figure it out, I'll box it up in a contribution. but it is possible, if you want to beat me to it.
Bookmarks