Showing 'Sold Out' for individual product options with no inventory

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