Skip to main content

Woo Dynamic Data Tree

Woo product dynamic data is exposed under omewoo on Etch post data when the post is a Woo product.

Use the same tree with different prefixes depending on context:

ContextPrefix
Product archive or product loop{item.omewoo...}
Single product template{this.omewoo...}

The examples below use {this.omewoo...}. In a product loop, replace this with item.

Product Tree

ExpressionTypeMeaning
{this.omewoo.productType}stringWoo product type, such as simple or variable.
{this.omewoo.productId}numberWoo product ID.
{this.omewoo.priceText}stringFormatted current product price text.
{this.omewoo.stockStatus}stringWoo stock status.
{this.omewoo.available}booleantrue when the product is purchasable and in stock.
{this.omewoo.product.id}numberProduct identity ID.
{this.omewoo.product.type}stringProduct identity type. Use this for AddToCartForm.product.product_type.
{this.omewoo.product.sku}stringProduct SKU.
{this.omewoo.product.name}stringProduct display name.

The top-level values are convenience aliases. The grouped objects are the more descriptive structure.

Price Tree

ExpressionTypeMeaning
{this.omewoo.price.currencyCode}stringStore currency code.
{this.omewoo.price.currencySymbol}stringDecoded store currency symbol.
{this.omewoo.price.raw}stringRaw Woo price.
{this.omewoo.price.regular}stringRaw regular price.
{this.omewoo.price.sale}stringRaw sale price.
{this.omewoo.price.text}stringFormatted price text.

The demo archive and single-product patterns use {item.omewoo.price.text} and {this.omewoo.price.text} for visible price copy.

Media Tree

ExpressionTypeMeaning
{this.omewoo.media.image.id}numberAttachment ID, or 0 when no attachment is available.
{this.omewoo.media.image.url}stringFull image URL.
{this.omewoo.media.image.alt}stringAttachment alt text, falling back to product or variant name.
{this.omewoo.media.image.title}stringAttachment title.
{this.omewoo.media.image.caption}stringAttachment caption.
{this.omewoo.media.image.description}stringAttachment description.
{this.omewoo.media.image.filename}stringImage filename.
{this.omewoo.media.image.srcset}stringWordPress image srcset.
{this.omewoo.media.image.width}numberFull image width.
{this.omewoo.media.image.height}numberFull image height.
{this.omewoo.media.image.filesize}numberAttachment filesize when available.
{this.omewoo.media.image.mime_type}stringAttachment MIME type.
{this.omewoo.media.image.sizes.full.url}stringFull-size URL when WordPress provides it.
{this.omewoo.media.image.sizes.full.width}numberFull-size width.
{this.omewoo.media.image.sizes.full.height}numberFull-size height.

sizes is keyed by registered WordPress image size names. Common keys include thumbnail, medium, large, and full, but the available keys depend on the site.

Purchase Tree

ExpressionTypeMeaning
{this.omewoo.purchase.available}booleanProduct can be purchased and is in stock.
{this.omewoo.purchase.purchasable}booleanWoo says the product is purchasable.
{this.omewoo.purchase.inStock}booleanWoo says the product is in stock.
{this.omewoo.purchase.stockStatus}stringWoo stock status.

AddToCartForm uses these values through its availability props. If the product is unavailable, the form disables its submit controls at runtime.

Attribute Tree

Variable products expose variation attributes under omewoo.attributes. Simple products intentionally expose an empty array.

Loop target:

{#loop this.omewoo.attributes as attribute}
...
{/loop}

Each attribute row has this shape:

ExpressionTypeMeaning
{attribute.key}stringStore API variation attribute key, such as attribute_pa_color.
{attribute.taxonomy}stringWoo taxonomy or local attribute name, such as pa_color.
{attribute.label}stringHuman-readable attribute label.
{attribute.required}booleanCurrent implementation marks variation attributes as required.
{attribute.options}arraySelectable option rows for AttributeSelector.

AttributeSelector expects the whole attribute object:

<OmeWooAttributeSelector target='{{"attribute":{attribute}}}' />

Attribute Option Tree

Inside an attribute, options are available as attribute.options. AttributeSelector loops this tree internally through props.target.attribute.options, but authors can also inspect it in custom loops.

ExpressionTypeMeaning
{option.label}stringOption display label.
{option.value}stringOption slug sent as the selected variation value.
{option.variationId}numberVariation ID when a single-attribute product can map the option to one variant; otherwise 0.
{option.priceText}stringVariant price text when available from a single-attribute variant.
{option.available}booleanWhether the mapped option is available.
{option.stockStatus}stringMapped variant stock status.
{option.image}objectImage payload using the same image shape as media.image.

Runtime copies option availability into data-ome-available, data-ome-unavailable, and data-ome-stock-status so unavailable variation choices can disable the parent form.

Variant Tree

Variable products expose all variation payloads under omewoo.variants. Simple products intentionally expose an empty array.

ExpressionTypeMeaning
{variant.id}numberVariation product ID.
{variant.label}stringLabel built from selected variation attribute values.
{variant.sku}stringVariation SKU.
{variant.priceText}stringFormatted variation price text.
{variant.regularPrice}stringRaw regular variation price.
{variant.available}booleanVariation can be purchased and is in stock.
{variant.stockStatus}stringVariation stock status.
{variant.product.id}numberVariation identity ID.
{variant.product.type}stringVariation product type.
{variant.product.sku}stringVariation SKU from the nested identity object.
{variant.product.name}stringVariation display name.
{variant.price.*}objectSame price tree as product omewoo.price.
{variant.media.image.*}objectSame image tree as product omewoo.media.image.
{variant.purchase.*}objectSame purchase tree as product omewoo.purchase.
{variant.attributes.attribute_pa_color}stringSelected value for a variation attribute key. Actual keys depend on the product.
{variant.image.*}objectLegacy flat image alias retained for existing dynamic-data consumers.

The variation attributes object is keyed by Store API variation attribute names. For taxonomy attributes this is typically attribute_pa_{slug}.

Common Product Bindings

Use caseProduct loopSingle product
Product ID{item.id} or {item.omewoo.productId}{this.id} or {this.omewoo.productId}
Product type{item.omewoo.product.type}{this.omewoo.product.type}
Product image URL{item.omewoo.media.image.url}{this.omewoo.media.image.url}
Product image alt{item.omewoo.media.image.alt}{this.omewoo.media.image.alt}
Product price{item.omewoo.price.text}{this.omewoo.price.text}
Variation attributes loopitem.omewoo.attributesthis.omewoo.attributes

Use item inside loops and this on single product templates. If this.omewoo.attributes is empty in preview, confirm the preview product is a variable product.

These are not under omewoo, but they are the other Woo dynamic sources authors can target directly.

cartItems

Loop target:

{#loop cartItems as item}
...
{/loop}
ExpressionTypeMeaning
{item.key}stringWoo cart item key.
{item.productId}numberProduct ID.
{item.title}stringComposed title, including selected variation labels when present.
{item.productTitle}stringParent product title.
{item.titleParts}arrayTitle parts used to compose title.
{item.attributes}arraySelected cart item attribute rows.
{item.quantity}numberCart item quantity.
{item.url}stringProduct permalink.
{item.priceRaw}stringRaw unit price.
{item.priceText}stringFormatted unit price text.
{item.subtotalRaw}stringRaw line subtotal.
{item.subtotalText}stringFormatted line subtotal text.
{item.media.image.*}objectCurrent item image payload.
{item.image.*}objectLegacy flat image alias retained for existing dynamic-data consumers.

Each item.attributes row has:

ExpressionTypeMeaning
{attribute.key}stringAttribute taxonomy key.
{attribute.name}stringHuman-readable attribute name.
{attribute.taxonomy}stringAttribute taxonomy.
{attribute.value}stringHuman-readable selected attribute value.

cartSummary

ExpressionTypeMeaning
{cartSummary.item_count}numberSum of cart quantities.
{cartSummary.line_count}numberNumber of cart lines.
{cartSummary.state}stringhas-items or empty.

cartTotals

ExpressionTypeMeaning
{cartTotals.total_price}stringRaw final total.
{cartTotals.totalPriceText}stringFormatted final total.
{cartTotals.total_items}stringRaw subtotal/items total.
{cartTotals.totalItemsText}stringFormatted subtotal/items total.
{cartTotals.total_discount}stringRaw discount total.
{cartTotals.totalDiscountText}stringFormatted discount total.
{cartTotals.total_shipping}stringRaw shipping total.
{cartTotals.totalShippingText}stringFormatted shipping total.
{cartTotals.total_tax}stringRaw tax total.
{cartTotals.totalTaxText}stringFormatted tax total.

cartCoupons

ExpressionTypeMeaning
{coupon.code}stringApplied coupon code.

shippingRates

Loop target:

{#loop shippingRates as rate}
...
{/loop}
ExpressionTypeMeaning
{rate.key}stringPackage-aware key in {package_id}:{rate_id} form.
{rate.package_id}numberShipping package index or package ID.
{rate.rate_id}stringRaw Woo shipping rate ID.
{rate.name}stringShipping rate label.
{rate.description}stringShipping rate description.
{rate.price}stringRaw shipping cost.
{rate.priceText}stringFormatted shipping cost.
{rate.selected}booleanWhether Woo currently has the rate selected for the package.

paymentMethods

Loop target:

{#loop paymentMethods as method}
...
{/loop}
ExpressionTypeMeaning
{method.id}stringPayment gateway ID.
{method.label}stringPayment gateway label.
{method.description}stringPayment gateway description.
{method.selected}booleanWhether Woo currently has this gateway selected.

Only enabled simple gateways are included. Gateways with custom embedded fields are skipped by this source.