Guest 1XCape Posted January 4, 2006 Share Posted January 4, 2006 Hi all, I'm new here. Running CC 3.0.6 but soon to upgrade to the 7 that has the working security patches. I'm just testing it right now. Here's my problem. I add a product and upload an image and it generates a thumbnail fine. On the product page though it shows the full sized image. I'd rather it show a thumbnail in the corner with a "click to see larger". My images are extremely small filesize-wise but I'd still like the smaller image, since it looks more streamlined that way. I'm using the Killer template btw if that's important. Thanks much! Quote Link to comment Share on other sites More sharing options...
convict Posted January 4, 2006 Share Posted January 4, 2006 As classic 'template system' CubeCart manages every template with own php file. If we are talking about product page that means we ar talking about viewProd.inc.php and viewProd.tpl. You have to search for appropriate template variable for generated image. Have look at viewProd.tpl and here is code like:<img src="{IMG_SRC}" and {IMG_SRC} is our template variable - path to one image. Have look at viewProd.inc.php and search for IMG_SRC. What you are seeing? Something like this: if(!empty($prodArray[0]['image'])){ $view_prod->assign("IMG_SRC","images/uploads/".$prodArray[0]['image']); } else { $view_prod->assign("IMG_SRC","skins/".$config['skinDir']."/styleImages/nophoto.gif"); } Simple PHP code with one condition: If we have got an image name IMG_SRC will be filled with image path else with thumbnail path. This was an explanation how it works. :sourcerer: Quote Link to comment Share on other sites More sharing options...
Guest 1XCape Posted January 4, 2006 Share Posted January 4, 2006 Thanks much. What do I do with it though? I have to admit, HTML has been my main language so far. I'm learning php. Thanks! Quote Link to comment Share on other sites More sharing options...
Guest aikdo Posted January 4, 2006 Share Posted January 4, 2006 (edited) Simple if you want it to show the Thumbnail instead of the full sized image just change if(!empty($prodArray[0]['image'])){ $view_prod->assign("IMG_SRC","images/uploads/".$prodArray[0]['image']); } else { $view_prod->assign("IMG_SRC","skins/".$config['skinDir']."/styleImages/nophoto.gif"); } to if(!empty($prodArray[0]['image'])){ $view_prod->assign("IMG_SRC","images/uploads/thumbs/thumb_".$prodArray[0]['image']); } else { $view_prod->assign("IMG_SRC","skins/".$config['skinDir']."/styleImages/nophoto.gif"); } that will substute it with a thumbnail if you want to create a link too then contact me and ill give you the rest the code... Edited January 4, 2006 by aikdo Quote Link to comment Share on other sites More sharing options...
convict Posted January 4, 2006 Share Posted January 4, 2006 aikdo what about to put rest of code here? :sourcerer: Quote Link to comment Share on other sites More sharing options...
Guest aikdo Posted January 4, 2006 Share Posted January 4, 2006 i will in due time... lol... but im busy at the moment... feel free for now if you wish convict... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.