![]() |
First detailed image instead of thumbnail
Ever wanted to replace the thumbnail on the product page with the first image from your detailed images and then have your detailed images section start with the second detailed image?
Well here is how to do it :) This code is for the 4.0 branch (the version for 3.4 and 3.5 is very similar) You need to modify two files: customer/product.tpl modules/detailed_product_images/product_images.tpl You will also need to make a new file: modules/detailed_product_images/product_images_one.tpl In product.tpl find this: Code:
<TD valign="top" align="left" rowspan="2" width="100"> replace with this: Code:
{***----ORIGINAL THUMBNAIL---- Then in product_images.tpl find this: Code:
<img src="{$images[image].tmbn_url}"> Replace with this: Code:
{***----ORIGINAL CODE------- Make a new file in modules/detailed_product_images called product_images_one.tpl Put this code in it: Code:
{* $Id: product_images_one.tpl,v 1.7.2.2 2005/07/29 10:43:25 CCS Exp $ *} That's it :) |
hi light speed um could u give us an example of the mod or give us a link to your site that shows an example of this mod that would be great :D
|
Don't really need an example, it does just what it says :) Nice one...moving it to Custom Mods.
|
Quote:
Yeah it's pretty straight forward :) I have boomers cart-lab tabbed mod installed also and you can see my little mod works fine with that :) |
lol
oh cool nice mod :) sorry for my dumbness :oops:
|
Thanks! :)
|
Hey,
Really cool mod and was looking for a long time and you saved my time a lot.. cheers !!!!! |
Glad to help! :)
|
Love it!
Works great! Does anyone know how this could be modified so the "detailed images" box only shows up if there are more than one detailed image? I have lots of products with only one image, and I now have one detailed image on top (nice) but a big old empty dialog box at the bottom. Looks like there is something missing.
Thanks again for the great mod! |
Re: Love it!
Quote:
There is probably a way to set an if statement at the detail dialog insert but I am too swamped to look into it. Maybe somebody else can take a stab at it? |
wrap it with
Code:
{if $images[1].image} |
Thanks, Shan, worked like a charm! For the information of others following this thread, I wrapped Shan's code around the following line in customer/main/product.tpl:
{include file="modules/Detailed_Product_Images/product_images.tpl" } Now here's another question for Shan or any other expert. If I have no image at all, how do I get the "no image" graphic to appear? Right now it's blank (where the first detailed image goes, which is where the thumbnail used to be). I really appreciate the help! |
try
Code:
{if $images eq ""} |
Hmmm, I can't seem to get this last bit (the code to show the "no image" image) to work. I've tried inserting it in a couple of places, now the "no image" image always shows up (if there already is a detailed image, now it shows up along with the "no image" one).
Am I trying it in the wrong place? I'm assuming it should somehow go in the modules/detailed_product_images called product_images_one.tpl somewhere. (Lightspeed posted this code in the opening message of this thread.) Again, thanks for your help! I'm awed by the quick and kind responses in this forum. |
sorry, i put
$image instead of $images i updated my other post |
Works great now. Thanks for the great mod and the great help getting it up and running!
|
|
If in your product.tpl you want to show the thumbnail when there is not detailed images, use:
Code:
{if $active_modules.Detailed_Product_Images ne "" && $images ne ""} |
In my detailed images it still showed the first detailed image in the detailed section below, after using it as the thumbnail.
Looking at the code of product_image.tpl I assumed this was because images were in the database. I modified the code to start the loop iteration after the first image to fix the problem. Code:
{section name=image loop=$images start=1} |
This is a great mod, but ? is there a way to also have the first detailed image show up as the thumbnail image in the catagory section also? Basically wanting to use the detailed image as the product image. Just curious if this can be also done?
Thanks |
Quote:
I am very interested in this as well. I use the code from Lightspeed and Shan, and it works well, but it would be nice to integrate this into the thumbnail view in the category display. |
love the code, but looking to do this...
we want the 2nd detailed image to popup in a seperate window when detailed images are clicked. some of our detailed images will be rather wide and will throw off the format of our xcart window. thanks |
Quote:
|
Quote:
There are pop up mods here. Just do a search and then look at my code and put it in the pop up mod. |
Question on mod
Hi,
I'm trying to apply this mod: Quote:
I find: Code:
</TD></TR></TABLE> Is this the correct place to modify and is it customer/main/product.tpl? Thank you. |
Re: Question on mod
Quote:
In 4.0.18 the raw code in customer/main/product.tpl looks like this: Code:
<TD valign="top" align="left" rowspan="2" width="100"> What version are you trying to work on? |
Mod
I'm using 4.0.18. Shall I post the entire code here? I can not locate the part you modified. I find the product.tpl in customer/main, is this the correct tpl?
|
Re: Mod
Quote:
Here is the complete customer/main/product.tpl file from 4.0.18 with the part separated out that needs replacing with code I provided in the instructions on page one of this thread. Code:
{* $Id: product.tpl,v 1.96.2.25 2005/11/17 11:40:11 max Exp $ *} |
Hello
I think I have another mod against this file is why it's not the same. I'll do some back tracking. Thank you for your help :)
|
Re: Hello
Quote:
No problem :D Good luck getting what you need accomplished! |
Re: First detailed image instead of thumbnail
Light Speed,
I'm trying to make the changes to my code, but can't find the area that needs changing in my Product_images.tpl as per your instructions. Below is a copy of whats in my Product_images.tpl can you please let me know where the code needs to be changed. Your help would be greatly appreciated. {if $images ne ""} {capture name=dialog} <DIV align="center"> {section name=image loop=$images} {if $images[image].avail eq "Y"} {if $images[image].tmbn_url} <IMG src="{$images[image].tmbn_url}" alt="{$images[image].alt|escape}"> {else} <IMG src="{$xcart_web_dir}/product_image.php?imageid={$images[image].imageid}" alt="{$images[image].alt|escape}"> {/if} <BR> <BR> {/if} {/section} </DIV> {/capture} {if $smarty.capture.dialog ne ""} {include file="dialog.tpl" title=$lng.lbl_detailed_images content=$smarty.capture.dialog extra="width=100%"} {/if} {/if} |
Re: First detailed image instead of thumbnail
Thanks to Balinor prob solved and works nicely.
Great mod! |
Re: First detailed image instead of thumbnail
Hi
Could you please tell me what code you changed on product_images.tpl? thanks |
Re: First detailed image instead of thumbnail
|
Re: First detailed image instead of thumbnail
Hi there, I want to do this with my version 4.1.8. can anyone instruct me? please.
|
Re: First detailed image instead of thumbnail
basically, i like to show product image first center on top, then description and others on the bottom... i can't seem to find mod for 4.1.8.
am i missing something |
Re: First detailed image instead of thumbnail
Hi
please look at http://www.sugarrays.co.uk/shop/product.php?productid=886&cat=1&page=1 is this what you are trying to achieve? So you would have larger image at the top and then the description of the product, then finally rest of your detailed images? if so then go to the link provided in the previous posts. |
Re: First detailed image instead of thumbnail
I have been using this mod with my live cart version 4.0.18 and love it. We are getting ready to migrate to 4.1.19 and the location of one file has changed and the other doesn't seem to exist.
So does anyone know how to implement this for 4.1.x branch? Scott Merritt www.pegasuspublishing.com/xcart/home.php xcart 4.0.18 live xcart 4.1.19 test |
Re: First detailed image instead of thumbnail
hi folks--- is there a simple way to get this working on version: X-Cart version 4.1.9?
please advise asap. thanks |
Re: First detailed image instead of thumbnail
Quote:
Looks like you have since changed the way that works a lot, how do I do it like you did it?! |
All times are GMT -8. The time now is 06:44 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.