Solution for achieving multiple columns of swatches:
Code:
{if $variants}
<table cellspacing="5" cellpadding="0" border="0" width="100%" align="center">
<tr>
<td colspan="6" height="20"><h2>{$lng.lbl_available_colors}</h2></font></td>
</tr>
{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"></td>
{foreach item=item key=key from=$variants[swatch].options}
<td width="16" height="16" class="{$item.option_name|replace:" ":""|replace:"/":""}">[img]{$ImagesDir}/resources/dot_clear.gif[/img]</td>
<td>{$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}
</table>
{else}
{/if}
This works for me to assign the number of columns to display the variant options amnd swatches. Similar to above, but with multiple columns. Thanks ETI for your code sample.
- Mike