To call the variantid, I simply needed to refer to it by name:
Code:
{$variants[swatch].variantid}
But, does anyone know what statement I can wrap around my A HREF so that if there isn't an image for the variant, it isn't a link? The color swatch uses an onclick, but how can I take advantage of the checkoptions and do this for a plain link? That is my final issue in the progression of my auto-generated swatches....
Thanks for your help,
Mike
Code:
{assign var="image_counter" value=0}
{section name=swatch loop=$variants}
{if $image_counter is div by 2}
<tr>
{assign var="image_counter" value=0}
{/if}
{math equation="x+1" x=$image_counter assign="image_counter" }
<td width="20" valign="top"></td>
{foreach item=item key=key from=$variants[swatch].options}
<td width="16" height="16" valign="top" class="{$item.option_name|replace:" ":""|replace:"/":""|replace:".":""}">[img]{$ImagesDir}/resources/dot_clear.gif[/img]</td>
<td valign="top">
{***
{$item.option_name}
***}
{$item.option_name}
</td>
{/foreach}
{capture name=image_index}
{math equation="index+x+1" index=$image_counter x=2}
{/capture}
{if $image_counter is div by 2 }
</tr>
{/if}
{/section}