CubeCart – Product Thumbnail in viewProd.tpl
Posted on October 19, 2007
Here's something that bugged me for a while. I'm working on an alternative image viewer for CC4, I don't like the old style pop up window and I don't think LightBox is really suitable.
Anyway, I needed the original product thumbnail visible on the view product page along with the additional images.
Here's how it's done.
After line 135 in includes/content/viewProd.inc.php add this
$thumbRoot = imgPath($prodArray[0]['image'], $thumb=1, $path="root");
$thumbRootRel = imgPath($prodArray[0]['image'], $thumb=1, $path="rel");
if (file_exists($thumbRoot)) {
$view_prod->assign("IMG_SRC_THUMB", $thumbRootRel);
} else {
$view_prod->assign("IMG_SRC_THUMB", $GLOBALS['rootRel']."skins/". SKIN_FOLDER . "/styleImages/thumb_nophoto.gif");
}
You can then reference it in yourskin/content/viewProd.tpl like this
Also posted on these threads; CubeCart.com & CubeCartForums.org
Related posts
- CubeCart Tax Classes on Product Page
A client of mine sells a mix of VAT and VAT exempt products via a... - CubeCart and WordPress Integration
Following my 100% CubeCart orientated posts, here's another late night hack. It integrates a WordPress... - Using WP-Ecommerce Product Downloads without checking out
I've used WP-Ecommerce for a few clients who required an online catalogue, rather than an... - Shopp Product Importer Download
Here are the latest versions of the Shopp Product Importer. I did not write these,... - CubeCart Mod – Side by Side Products Mod
This universal modification allows you to show your products side by side on the "View...


