Jump to content

Change View Product to show all thumbnail


Guest fozz

Recommended Posts

I would like to modify my "View Product" page to show all of the images as thumbnails.

Currently it shows the main image large and any extra images are shown as small thumbnails that are viewable via the lightbox, but I want all the images in the thumbnails section so I can remove the large image.

I assume this change can be made in viewProd.inc.php but I don't understand PHP well enough to figure it out.

If anyone has suggestions for me, please help.

-Josh

Link to comment
Share on other sites

I think I have to change something in the following code, but I'm not sure what. Can someone point me in the right direction?

			$imgs = $db->select("SELECT img FROM ".$glob['dbprefix']."CubeCart_img_idx WHERE productId = ".$db->mySQLsafe($prodArray[0]['productId']));

			for ($i=0; $i<count($imgs); $i++){

				$thumbRootPath = imgPath($imgs[$i]['img'],$thumb=1,$path="root");

				$thumbRelPath = imgPath($imgs[$i]['img'],$thumb=1,$path="rel");

				

				if (file_exists($thumbRootPath)) {

					

					$view_prod->assign("VALUE_THUMB_SRC",$thumbRelPath);

					$sizeThumb = getimagesize($thumbRootPath);

					$view_prod->assign("VALUE_THUMB_WIDTH",$sizeThumb[0]);

					

				} else {

					$view_prod->assign("VALUE_THUMB_SRC",imgPath($imgs[$i]['img'], 0, 'rel'));

					$view_prod->assign("VALUE_THUMB_WIDTH",$config['gdthumbSize']);

				}

				

				$view_prod->assign("VALUE_IMG_SRC", imgPath($imgs[$i]['img'], 0, 'rel'));

				$view_prod->assign("ALT_THUMB",$lang['viewProd']['thumb_alt']);

				$view_prod->parse("view_prod.prod_true.image_gallery.img_repeat");

			}

			$view_prod->assign("IMAGE_GALLERY",$lang['viewProd']['image_gallery']);

			$view_prod->parse("view_prod.prod_true.image_gallery");

		}

Link to comment
Share on other sites

  • 2 weeks later...

I'm with you on this one... Did you ever get it worked out?

No not exactly, I simply added a width property to the big image to make it match the size of the thumbnails. I also added it to the light box group so that when it is clicked on, it will pull up the lightbox and be in the same "group" with the thumbnails. Not very elegant, but it works fine and you don't have to change any of the "core" code, only your skin code (viewProd.tpl).

<a href="{IMG_SRC}" rel="lightbox[imageset]"><img src="{IMG_SRC}" alt="{TXT_PRODTITLE}" border="0" title="{TXT_PRODTITLE}" width="100px" /></a>

So you see I added:

rel="lightbox[imageset]

to make it appear with the lightbox group

and I added:

width="100px"

to match the size of my thumbnails. Your thumbnails maybe different.

Hope this helps!

Link to comment
Share on other sites

Guest philoye

No not exactly, I simply added a width property to the big image to make it match the size of the thumbnails. I also added it to the light box group so that when it is clicked on, it will pull up the lightbox and be in the same "group" with the thumbnails. Not very elegant, but it works fine and you don't have to change any of the "core" code, only your skin code (viewProd.tpl).

<a href="{IMG_SRC}" rel="lightbox[imageset]"><img src="{IMG_SRC}" alt="{TXT_PRODTITLE}" border="0" title="{TXT_PRODTITLE}" width="100px" /></a>

So you see I added:

rel="lightbox[imageset]

to make it appear with the lightbox group

and I added:

width="100px"

to match the size of my thumbnails. Your thumbnails maybe different.

Hope this helps!

It does, thanks! I like clean solutions that don't involve hacking core.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...