# Product option

The product_option object is available for each option in a product options array.

The `product_option` object is available for each option in a product options array. The product options array is available through [product.options_with_values](https://developer.versacommerce.de/articles/liquid-objects-product#product-optionswithvalues).

The `product_option` object has the following attributes:

## product_option.name

Returns the name of the product option.

## product_option.position

Returns the position of the product option in the product options array.

```liquid
 <ul>

  {% for product_option in product.options_with_values %}

  <li>{{ product_option.position }} - {{ product_option.name }} </li>
  {% endfor %}

 </ul>
```

```html
<ul>
  <li>1 - Color</li>
  <li>2 - Size</li>
</ul>
```

## product_option.selected_value

Returns the currently selected value of this product option.

```liquid
<select>
  {% for value in product_option.values %}
    <option {% if product_option.selected_value == value %}selected{% endif %}>{{ value }}</option>
  {% endfor %}
</select>
```

```html
<select>
  <option selected>Red</option>
  <option>Green</option>
</select>
```

## product_option.values

Returns an array of possible values of this product option.

```liquid
 <ul>

  {% for value in product_option.values %}

  <li>{{ value }}</li>
  {% endfor %}

 </ul>
```

```html
<ul>
  <li>Red</li>
  <li>Green</li>
</ul>
```
