The customer's always right? …right? lol.
My client's requested that the word 'Sold Out' appears next to product options (in the drop-down menu) that don't have inventory in stock.
Seems easy enough, thinking I could just use
{if $product_amount == 0} Sold Out {/if}
But that failed. It only works when the option with zero inventory is selected, but then all the options display 'Sold Out' dynamically.
Here's the whole code I'm working with:
```php
{if $po.disabled}{$lang.select_option_above}{else}{$lang.please_select_one}{/if}{/if}
{foreach from=$po.variants item="vr" name=vars}{if !$po.disabled || ($po.disabled && $po.value && $po.value == $vr.variant_id)}
{$vr.variant_name} {if $show_modifiers}{hook name="products:options_modifiers"}{if $vr.modifier|floatval}({include file="common_templates/modifier.tpl" mod_type=$vr.modifier_type mod_value=$vr.modifier display_sign=true}){/if}{/hook}{/if} {if $product_amount == 0}Out of Stock{/if}
{/if}{/foreach}
```
This is the lovely mockup they provided me... oi...