X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Lazy way around product option images (https://forum.x-cart.com/showthread.php?t=14662)

extreme 06-19-2005 06:35 PM

Lazy way around product option images
 
In a perfect world I wanted my product images to update depending on the product option chosen (ie. 250g would show a 250g jar, 1kg would show a 1kg jar.)

Unfortunately I don't have the time or skills to implement that so here's a cheap and nasty way around it.

I have just changed the detailed product images module a little so that now I have a product option images list. Now on the product detail screen it shows a list of the available sizes and their images. It doesn't link to anything, and it's probably a bit of a double up as you have to enter the options in the product options section and then again in the description for each image but at least now I have pictures for each option!

Change modules\detailed_product_images\product_images.tpl from this:

Code:

{* $Id: product_images.tpl,v 1.10.2.1 2004/05/18 06:23:01 mclap Exp $ *}
{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]{$images[image].tmbn_url}[/img]
{else}
[img]{$xcart_web_dir}/product_image.php?imageid={$images[image].imageid}[/img]
{/if}




{/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}


To this:

Code:

{* $Id: product_images.tpl,v 1.10.2.1 2004/05/18 06:23:01 mclap Exp $ *}
{if $images ne ""}
{capture name=dialog}
<div align=left><table border=0 width=100% cellpadding=0 cellspacing=0>
{section name=image loop=$images}
<tr><td width=30%>
{if $images[image].avail eq "Y"}
{if $images[image].tmbn_url}
[img]{$images[image].tmbn_url}[/img]



{else}
[img]{$xcart_web_dir}/product_image.php?imageid={$images[image].imageid}[/img]



{/if}</td>
<td valign=top>{$images[image].alt}</td>
</tr>
{/if}
{/section}
</table>
</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}


Change the lbl_detailed_images label from "Detailed images" to "Product option images"

Change the two occurances of "Alternativetext" in modules\detailed_product_images\product_images_mod ify.tpl to "Description"

In main\product_modify.tpl, change 'title="Detailed images"' to 'title="Product option images"' (down the bottom)

Online Michael 06-20-2005 04:58 AM

Is it possible to see this in action anywhere?

extreme 06-20-2005 03:27 PM

You'll have to excuse my dodgy product images; I haven't been given any real ones yet. You get the idea though.


http://www.denco.com.au/home/screenshot.jpg


All times are GMT -8. The time now is 04:18 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.