Thumbnail and main image

I have been trying to figure out an easy way to do this, but nothing seems to work

I have a thumbnail image already for each product and a main image as well



I want to use the current thumb and detailed image feature in cs-cart to upload these 2 images - there will never be a need for a larger product image



So I load the 2 images no troubles

when i view the product list - thumb is fine - since I turned off thumbnail creation in the admin - but when I click on the thumb to get to the product details - of course it shows the thumbnail image as the main image view with the usual click here for larger image - which does work - but I want that detailed image to show here in the products details page.



so I decided I will leave the common_templates/image.tpl as is for the thumb - and in the product_pages folder change the product_details.tpl to include a revised version of that tpl called my-image.tpl



Seesm simple enough to get the detailed version here - but I cant seem to get the right info to correctly display the detailed image - any ideas



I have stripped my-image.tpl down to just the basics to output the image - so I guess I am just not getting the right info from variables etc… as most are related to the images.icon version…



Basically I have this kind of idea:



{php}

$Myimage_path = db_get_field(“SELECT image_path FROM cscart_detailed_images WHERE image_id=‘$images.detailed_id’”);

{/php}







Should work - but doesnt look like the db_get_field is getting executed - am I allowed to do this in the tpl?



any thoughts?



Thanks in advance

Do you want to achieve the same sort of thing we have here : [url]http://www.ball-gowns.co.uk/adrianna-p316.html[/url] ?



If I can remember correctly you should be able to change the “icon” to "detailed throughout the replacement images.tpl file.



I am just finishing this section for 1.3.5 SP2 and there seem to be no major changes with the image.tpl file.



When I get a chance I will post the changes I made.

mwanless - yes this is what I am trying to acheive I believe - let me try replacing the icon part as you mentioned - maybe I was trying to do too much

mwanless



oh my gosh - how silly am I - that was very much appreciated - this has achieved the desired effect.



THANKS

Hi,

I was trying to edit the Image.tpl



Do you have the exact lines you changed?

Can you post that up?

Thanks

polo



this is my revised version - make a backup of yours first



{* $Id: image.tpl 4482 2007-12-21 15:36:34Z brook $ }

{strip}



{if $settings.Addons.seo == ‘Y’}

{assign var=“image_location” value=“$current_location/”}

{else}

{assign var=“image_location” value=“$smarty.const.CSCART_HOST_DIR/”}

{/if}



{if !$image_width}

{if $images.detailed.image_x}

{assign var=“image_width” value=$images.detailed.image_x}

{/if}

{if $images.detailed.image_y}

{assign var=“image_height” value=$images.detailed.image_y}

{/if}

{else}

{if $images.detailed.image_x && $images.detailed.image_y}

{math equation=“new_x * y / x” new_x=$image_width x=$images.detailed.image_x y=$images.detailed.image_y format=“%d” assign=“image_height”}

{/if}

{/if}



{if $show_thumbnail == ‘Y’ && $image_width && $images.image_id}

{assign var=‘object_type’ value=$object_type|default:‘product’}

{assign var=‘detailed_image_path’ value=“$smarty.const.CSCART_HOST_DIR/$image_index?$mode_name=show_thumbnail&image_id=$images.image_id&object_type=$object_type&width=$image_width”}

{else}

{assign var=‘detailed_image_path’ value=$images.detailed.image_path}

{/if}



{if $images.detailed.image_type != ‘application/x-shockwave-flash’}

{if $detailed_href}



{/if}



{if $obj_id && !$no_ids}

“”


{/if}



“{$images.detailed.alt|escape:html}”

{


“{$images.detailed.alt|escape:html}”

*}

{if $detailed_href}



{/if}

{else}

http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0” {if $image_width}width=“{$image_width}”{/if} {if $image_height}height=“{$image_height}”{/if}>





{if $flash_vars}

{/if}


{/if}

{if $show_detailed_link}


{$lang.view_larger_image}


{/if}

{/strip}

{if $obj_id && !$no_ids}

{/if}

thanks

Also you wouldnt happen to know how to change the view larger image to link to the large additional image. Pretty if i click on view larger image i want to point to the backcover larger image.

thanks

poloxstar



the code here is using the current setup of cs-cart which has 2 images - a thumbnail version and a popup version



my issue was that I wanted to enter a thumb myself and the main image - and not let cs-cart generate a thumb for me - so I used the popup field as my detailed image version… the end result is there are still only 2 images being used…



what you are looking for is 3 images and i would recommend that you use the additional images feature for your back cover or put the backcover inline in the product description or something like that.

I copied the code to the image.tpl but there seems to a problem. The product list images are not being displayed. Do you know the reason why?

Thanks

poloxstar



as I mentioned - this version of the image.tpl is only called from the product_details.tpl page and not the general image display - I have a files called image.tpl that is used like normal - but in the product_details.tpl I replaced the include for the image.tpl file with my revised version myimage.tpl and this is the code - this allow me to work with special information on the details page.



hope that helps

Thanks for this guys, I have been looking for this since I upgraded to 1.3.5



:smiley:

[quote name=‘DELTA9000’] since I turned off thumbnail creation in the admin -

[/QUOTE]



can anyone tell me where this is on latest v ?