Skip to main content

Product options

The ProductOptions object is the second argument to Selektable.open(). It provides product data and cart callbacks to the widget.

Reference

Product information

string | number
Unique identifier for the product. Used to track generations and conversions.
string
Display name of the product. Shown in the widget UI.
string
Primary image URL used for AI generation. This is the image the AI model uses to render the product in the customer’s photo.If not provided, the first image in productImages is used.See Choosing the right product image for best practices on selecting this image.
ProductImage[]
Array of all product images displayed in the widget.
string
URL of the product page. Used for sharing and navigation.

Variable product data

These fields are primarily used for WooCommerce-style variable products where a single product has multiple variations (e.g., different colors/sizes).
string
Product type. One of: simple, variable, grouped, external.
array
Available variations for variable products.
array
Product attributes that have variations.
boolean
Whether the product can be purchased. If false, the add-to-cart button may be hidden.
boolean
Whether the product is in stock.

Product dimensions

Optional physical measurements that help the AI render the product at its real-world size relative to the room.
ProductDimensions
Physical dimensions of the product. When provided, the AI uses these measurements to calculate correct proportions relative to the room and other objects in the scene.
At least one dimension value (width, height, or depth) should be provided alongside the unit.
Providing dimensions is especially useful for furniture and home decor products where accurate sizing in the room visualization makes a big difference.

Cart callbacks

function
Called when the customer clicks “Add to Cart” in the widget. See Cart Integration for details.Signature:
CartProduct:
CartVariation:
CartResult:
function
Called when the customer clicks “View Cart” after a successful add-to-cart.
function
Called when the customer clicks “Checkout” after a successful add-to-cart.

Product context resolution

The widget resolves product data in this priority order:
  1. Explicit options passed to Selektable.open(widgetId, options) — highest priority
  2. Data attributes on the context element (data-selektable-widget)
  3. Auto-detection from the page DOM (WooCommerce body classes, JSON-LD, variation forms, etc.)
Auto-detection works with common ecommerce page structures, including WooCommerce product pages, JSON-LD structured data, and standard product data attributes.
For custom platforms, always pass product data explicitly via Selektable.open() options. Auto-detection is designed for WooCommerce pages.