View Single Post
  #5  
Old 10-07-2005, 12:41 PM
 
tabarsoft tabarsoft is offline
 

Advanced Member
  
Join Date: Sep 2005
Location: Montrц╘al, Canada
Posts: 31
 

Default Re: Auto-Generated Color or Image Swatches from Product Opti

Hello I've combined your mod with ETI's and have color swatch on 5 colums and i'm using images instead of css.

Feel free to use.

Code:
{if $variants} <table cellspacing="3" cellpadding="0" border="0" width="100%" align="center"> {assign var="image_counter" value=0} {section name=swatch loop=$variants} {if $image_counter is div by 5} <tr> {assign var="image_counter" value=0} {/if} {math equation="x+1" x=$image_counter assign="image_counter" } {foreach item=item key=key from=$variants[swatch].options} <td>[img]{$ImagesDir}/{$item.option_name|replace:[/img]</td> {/foreach} {capture name=image_index} {math equation="index+x+1" index=$image_counter x=2} {/capture} {if $image_counter is div by 5 } </tr> {/if} {/section} </table> {else} {/if}

However I still got this issue.
Quote:
Originally Posted by tabarsoft
Hi I've used you mod and it works well thanks.
But..... there's always a but

I want my customer to be able to disable some of the variants if a color becomes unavailable. If you do so, color_swatches.tpl still do the loop as if all the variants were still available. The result is that I get blank space with an X at the place of the picture.

Have you figure out how to skip th variant if its disable?
__________________
x-cart gold 4.0.15
Reply With Quote