Item Options for Commerce 1.1

The ItemOptions module is a useful tool to allow easy configuration of products. Think choosing sides to go with a burger, or bespoke products made to order.

The resulting item is a custom product (not unlike what you’d get with a custom add to cart snippet).

Today’s v1.1 update stores the product_id and sku on the created item adjustment to allow you to access detailed information (e.g. by passing the product_id to the commerce.get_product snippet) or for other integration purposes.

The way you’d access these values in a Twig template where you’re looping over the adjustments:

{{ adjustment.properties.itemopt_product.product_id }}
{{ adjustment.properties.itemopt_product.sku }}

This feature was contributed by @ankurvr - thank you!

2 Likes