Images for Product Option VIARANTS...not combinations

Please make it so that you can have unique images for each product option VARIANT instead of having to use option combinations.



What I mean is…if I have 2 product options (Size, Color)… and each option has 3 variants (S,M,L … Blue,Red,Green), Make it so that I can set an image to the VARIANTS rather than having to use combinations.



This way, if I want to have only 1 image for Red, regardless of the size, I will only have to set its image ONCE rather than 3 times for each size/color combination.

we’ve been asking for this forever, cs hello? anyone out there?

[quote name=‘snorocket’]we’ve been asking for this forever, cs hello? anyone out there?[/QUOTE]



I am just starting to work on this now and mine works, but there may be a better way to do this? This is just some javascript and a couple of if statements in the product_options.tpl. Basically, when you set up global options on a select box a variable for the variants gets saved in the database. I just save all the images I want and name them this variable (e.g., 50412.gif). It is probably bad coding to put the javascript in {literal} tags but I may try to fix that later. Blue text below shows the original code from the tpl. I’m still working on old version 1.3.4, but maybe it will apply also to newer versions? I also haven’t tested this for having two or more different product options have variant image changing on the same page. If anyone comes up with (or has already come up with) a slicker version of this, please share. Like I said, I’m sure there is a better way to do this, but it works for me.



[COLOR=“Blue”]{if $po.option_type == “S”} {Selectbox}[/COLOR]

{if $po.option_text != “yourglobaloptiondescription” && “yoursecondglobaloptiondescription”}



[COLOR=“blue”]

{foreach from=$po.variants item=“vr” name=vars}