View Single Post
  #2  
Old 12-03-2013, 05:57 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Show variant "out of stock" on dropdown

Here is some old code that might at least point you in the right direction ("oos" is out of stock):
PHP Code:
{foreach from=$p.product_options item=v}
  {foreach 
from=$v.options item=o}
    {
assign var=oos value=0}
    {if 
$p.variants}
      {foreach 
from=$p.variants item=var}
        {foreach 
from=$var.options key=void item=vop}
          {if 
$void eq $o.optionid}
            {if 
$var.avail lt 1}
              {
assign var=oos value=1}
            {else}
              {
assign var=oos value=0}
            {/if}
          {/if}
        {/foreach}
      {/foreach}
    {/if} 
Then you can use the "oos" flag on the drop down to add a message or disable it. Here is an example:
PHP Code:
<option value="{$o.optionid}"{if $o.selected eq 'Y'selected="selected"{/if}{if $oosdisabled="disabled"{/if}>{if $oos}out of stock{/if} 
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote