Only show a Text link if Product has Variant option Size

Hi,

I am looking for a way to show a text link under the Variant Size options, and hide that link for products that don’t have the Variant Size option, or any other option).

I tried this code, but that does not work:

{%- unless product.options.first.empty? -%}
Open Size table
{%- endunless -%}

This will also show on product pages that don’t have Size options.

I am not sure if checking if the first variant is empty is correct. Maybe there is a better/smarter way of checking if the Size is used or not.

Any help is much appreciated!

FIXED!

After several attempts I finally found the code “if product.options[0] == ‘Size’” to make this work:

{%- if product.options[0] == "Size" -%} 
Open Size table 
{%- endif -%}