I have set up a T-Shirt with the Options Configurator field type named 'inventory_and_options' but can't work out how to display its selected item options in an invoice.
The products options are:
Size: Red, Blue
Colour: Small, Medium
I have created an order for a medium blue Tshirt.
My invoice code:
{exp:cartthrob:order_items order_id="{entry_id}"}
{item:title}<br>
{item_options}
Option Label = {option_label}<br>
Option Name = {option_name}<br>
Option Value = {option_value}<br>
{/item_options}
{/exp:cartthrob:order_items}
This displays:
Great T-Shirt
Option Label = Inventory and Options
Option Name = Medium Blue
Option Value = sku-medium-blue
Option Label = Inventory And Options:size
Option Name = Medium
Option Value = Medium
Option Label = Inventory And Options:colour
Option Name = Blue
Option Value = Blue
So that has looped through all the item_options but all I want it to give me is:
Great T-Shirt
Size: Medium
Colour: Blue
If I get rid of the item_options tag and hard code the fields created in the order items field in the orders channel..
{exp:cartthrob:order_items order_id="{entry_id}"}
{item:title}<br>
{item:inventory_and_options}<br>
{if item:inventory_and_options:size}Size: {item:inventory_and_options:size}{/if}<br>
{if item:inventory_and_options:colour}Colour: {item:inventory_and_options:colour}{/if}<br>
{/exp:cartthrob:order_items}
Displays:
Great T-Shirt
sku-medium-blue
Size: Medium
Colour: Blue
Which is close but obviously causes a problem if I add other product options other than size and colour as I would have to manually update the template whenever I add a new product option.
Sorry for the rambling explanation, has anyone else had problems displaying options in an invoice?