<p>You can also loop through each object within the <code>options</code> array using:</p>

<pre><code>{% for key, value in item.options %}
  {{ key }} - {{ value }}
{% endfor %}
</code></pre>

CC BY-SA 3.0
2016-06-13T10:31:08.620Z
2016-06-13T10:31:08.620Z
Luke Pearce
<p>Answer is the example code for the cart:</p>

<pre><code>{{ item.options.giftWrapped }}
</code></pre>

CC BY-SA 3.0
2016-06-13T10:22:55.867Z
2016-06-13T10:22:55.867Z
Dan Lee
<p>In the cart example code the selected options are displayed in an unformatted list like so:</p>

<pre><code>{{ item.options|json_encode }}
</code></pre>

<p>I noticed that the note field text could be outputted individually like so:</p>

<pre><code>{{ item.note }}
</code></pre>

<p>I'm looking to do the same for the select fields on my product, so if I had a list of options like the gift wrap example, how would I then output the result individually (so that I can format how I like)?</p>

<pre><code>&lt;select name="options[giftWrapped]"&gt;
  &lt;option value="no"&gt;No gift wrap.&lt;/option&gt;
  &lt;option value="yes"&gt;Gift wrapped.&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<plugin-craftcommerce>
Craft Commerce: Displaying Individual Product Options in the Cart?
# Craft Commerce: Displaying Individual Product Options in the Cart?

(Asked by: username_0 on 2016-06-13)

In the cart example code the selected options are displayed in an unformatted list like so:
{{ item.options|json_encode }}

I noticed that the note field text could be outputted individually like so:
{{ item.note }}

I'm looking to do the same for the select fields on my product, so if I had a list of options like the gift wrap example, how would I then output the result individually (so that I can format how I like)?

  No gift wrap.
  Gift wrapped.

**Tags:** plugin-craftcommerce


---

## 2 answers

### Answer by username_0 on 2016-06-13. Score: 6 | Accepted answer

Answer is the example code for the cart:
{{ item.options.giftWrapped }}


---

### Answer by username_1 on 2016-06-13. Score: 5

You can also loop through each object within the options array using:
{% for key, value in item.options %}
  {{ key }} - {{ value }}
{% endfor %}


---

