How can I pre-select a product variant based on user profile? I have a product variant that a user can choose from. It looks like this:

&lt;select name="purchasableId" class="form-control"&gt;
    {% for purchasable in product.variants %}
        &lt;option {% if purchasable.stock &lt;= 0 and purchasable.unlimitedStock == false %}disabled {% endif %} value="{{ purchasable.purchasableId }}"
            {% if currentUser is defined and purchasable.myCustomField in currentUser.userField %}selected{% endif %}&gt;{{ purchasable.myCustomField.label }} &amp;ndash; {{ purchasable.price|currency(cart.currency) }}&lt;/option&gt;
   {% endfor %}
&lt;/select&gt;


Where I'm stuck is this:

purchasable.myCustomField


Should (and does) equal this:

{{ currentUser.userField }}


I know it's a syntax problem... just not sure where I'm off.

EDIT

To test, this is what the data looks like:

purchasable.myCustomField  // this is a drop down value is "blue"
currentUser.userField      // this is a checkbox that has the value "blue" in it
Checkboxes fields (and other multi-select fieldtypes) return a MultiOptionsFieldData instance, not an array.

This should work:

{% if currentUser.userField.contains(purchaseable.myCustomField) %}