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, variable, or variation.
{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.

Variation Post Context

When the current post is a native Woo product_variation, the base omewoo tree describes the variation itself. Variation posts expose variation-level price, media, purchase, and product identity fields. They do not expose parent selector data through omewoo.attributes or omewoo.variants; those arrays stay empty outside the parent variable product context.

Use parentProduct when a variation template needs the parent product identity:

ExpressionTypeMeaning
{this.omewoo.parentProduct.id}numberParent product ID for a variation post. Empty on non-variation products.
{this.omewoo.parentProduct.type}stringParent product type, usually variable.
{this.omewoo.parentProduct.sku}stringParent product SKU.
{this.omewoo.parentProduct.name}stringParent product display name.

Use selectedAttributes for displayable selected variation attributes:

{#loop this.omewoo.selectedAttributes as attribute}
{attribute.label}: {attribute.valueLabel}
{/loop}

Each selected attribute row has this shape:

ExpressionTypeMeaning
{attribute.key}stringStore API variation attribute key, such as attribute_pa_color.
{attribute.taxonomy}stringRaw Woo taxonomy or local attribute name, such as pa_color or Shoe Size.
{attribute.label}stringHuman-readable attribute label.
{attribute.value}stringStored selected value, such as blue.
{attribute.valueLabel}stringTerm name when resolvable, otherwise a readable value fallback.

selectedAttributesMap is the machine-readable selected value map. It uses the same normalized Store API keys as variant.attributes, for example:

{
"attribute_pa_color": "blue",
"attribute_shoe-size": "large"
}

For author-facing output, prefer the selectedAttributes loop. Use selectedAttributesMap when a template or runtime integration needs normalized selected values by key.

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.
{this.omewoo.price.html}stringSanitized Woo price HTML, including ranges or sale markup where Woo supplies it.
{this.omewoo.price.currentHtml}stringSanitized server-formatted current price amount.
{this.omewoo.price.regularHtml}stringSanitized server-formatted regular price amount.
{this.omewoo.price.saleHtml}stringSanitized server-formatted sale price amount, or an empty string when there is no sale price.

Use price.html as the authored content for OmeWooProductPrice. The atom's price_display prop selects the matching HTML field after a variation resolves. The browser never reconstructs currency or tax presentation.

Description Tree

ExpressionTypeMeaning
{this.omewoo.description.html}stringFull product description after WordPress formatting and sanitization.
{this.omewoo.description.shortHtml}stringShort product description after Woo formatting and sanitization.

Bind either field to OmeWooProductDescription.content. Inside a Product Provider, a resolved variation uses its sanitized variant.description.html and falls back to the authored base content when its own description is empty.

Media Tree

ExpressionTypeMeaning
{this.omewoo.media.image.id}numberPrimary attachment ID, or 0 when no attachment is available. When the product has no featured image, the first valid gallery attachment is promoted.
{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.
{this.omewoo.media.gallery}arrayCurrent product display gallery. The primary image is first, followed by de-duped Woo product gallery images.
{this.omewoo.media.variationGalleries}arrayVariable-product variation media rows for selector-aware image and gallery UI. Empty on simple products and native variation posts.

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.

Each media.gallery row uses the same image shape as media.image, including id, url, alt, title, caption, srcset, dimensions, MIME type, and responsive sizes.

Bind media.image.id to OmeWooProductImage.media_id for a server-rendered hero image and bind the complete media.gallery array to OmeWooProductMedia.media. Inside the Product Media default slot, bind media.id to a nested Product Image. Etch derives registered responsive image output from the attachment ID; leave Product Image alt empty to use the media-library alt text.

Inside the nearest Product Provider, Product Media selection changes only the active image. It does not alter attributes, resolve a variation, mutate the cart, or dispatch ome-woo:variation-selection-changed. Resolving a variation replaces the effective gallery, and reset restores the base product gallery.

On a native Woo product_variation post, media.gallery describes that variation. The variation post context does not expose a parent selector map through media.variationGalleries.

Parent variable products expose media-focused variation rows under omewoo.media.variationGalleries. This keeps full gallery payloads out of omewoo.variants, which stays the purchase and selection catalog commonly serialized into AddToCartForm.

Loop target:

{#loop this.omewoo.media.variationGalleries as variationGallery}
...
{/loop}

Each variationGallery row has this shape:

ExpressionTypeMeaning
{variationGallery.variationId}numberVariation product ID.
{variationGallery.attributes.attribute_pa_color}stringSelected value for a variation attribute key. Actual keys depend on the product.
{variationGallery.image.*}objectPrimary image payload using the same image shape as product omewoo.media.image.
{variationGallery.gallery}arrayDisplay gallery for that variation. Each row uses the same image shape as media.image.

Variation gallery rows mirror Woo's product-image fallback behavior:

  • When the parent product has no featured image, its first valid gallery image becomes the base primary image.
  • When a variation has no owned images, its gallery uses the parent featured image plus parent gallery images.
  • When a variation has only a featured image, that image is first and parent gallery extras follow.
  • When a variation has a variation-owned gallery, that gallery is used, with the selected primary image first.
  • When a variation has a gallery but no featured image, the first valid variation gallery image becomes the primary image.

Use omewoo.media.variationGalleries for gallery components that need to react to selected attributes. Use omewoo.variants for resolving purchasable variation IDs, availability, price, and form submission data.

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.
{this.omewoo.purchase.availabilityHtml}stringSanitized Woo availability HTML for the current product.
{this.omewoo.purchase.quantity.min}numberWoo minimum purchase quantity.
{this.omewoo.purchase.quantity.max}number | nullWoo maximum purchase quantity, including a finite stock limit when applicable. null means unbounded.
{this.omewoo.purchase.quantity.step}numberWoo purchase quantity step. Decimal values are preserved.
{this.omewoo.purchase.quantity.soldIndividually}booleantrue when Woo fixes the product quantity at one.

AddToCartForm uses the availability values through its props. A counter AddToCartButton using stepper presentation inside ProductProvider also reads the current product or variation's purchase.quantity object. Authored quantity props can tighten these rules but cannot loosen them. 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 option has at least one purchasable matching variation.
{option.partialAvailable}booleanSame partial-selection availability, exposed explicitly for multi-attribute products.
{option.matchingVariationIds}arrayPurchasable variation IDs that include this option value.
{option.stockStatus}stringMapped single-variation stock status, or the first purchasable partial match stock status.
{option.image}objectImage payload using the same image shape as media.image.
{option.swatchImage.id}numberStable variation-owned image ID for an image swatch, or 0 when the complete matching variation set is missing an owned image or uses different images.

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. On multi-attribute products, an option is available when at least one purchasable variation can still match that partial selection; the final variation_id is resolved from the complete selection and omewoo.variants.

swatchImage is deliberately smaller and stricter than option.image. It is resolved from every matching variation, including unavailable and wildcard variations, and never falls back to a parent product image. Existing option.image, variant.image, and variant.media.image paths remain unchanged for compatibility. AttributeSelector uses only swatchImage.id to render its Dynamic Image block; Etch derives the responsive image data from that attachment ID.

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.description.html}stringSanitized Woo variation description.
{variant.media.image.*}objectSame image tree as product omewoo.media.image.
{variant.purchase.*}objectSame purchase tree as product omewoo.purchase, including variation-specific quantity limits.
{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.

variant.media intentionally exposes only image. Full variation galleries live in omewoo.media.variationGalleries so the purchase catalog remains compact when passed into AddToCartForm.

For a two-attribute product such as color plus size, bind both trees into the purchase form:

<OmeWooAddToCartForm product='{{"product_id":"{this.id}","product_type":"{this.omewoo.product.type}","variants":{this.omewoo.variants}}}'>
{#slot default}
{#loop this.omewoo.attributes as attribute}
<OmeWooAttributeSelector target='{{"attribute":{attribute}}}' />
{/loop}
<OmeWooAddToCartButton behavior='{{"trigger":"form_submit"}}' />
{/slot}
</OmeWooAddToCartForm>

Do not read option.variationId as the final variation for multi-attribute products. It is 0 until the selected attribute values map to a complete variation record.

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 gallery loopitem.omewoo.media.gallerythis.omewoo.media.gallery
Variation gallery mapitem.omewoo.media.variationGalleriesthis.omewoo.media.variationGalleries
Product price HTML{item.omewoo.price.html}{this.omewoo.price.html}
Product SKU{item.omewoo.product.sku}{this.omewoo.product.sku}
Product availability HTML{item.omewoo.purchase.availabilityHtml}{this.omewoo.purchase.availabilityHtml}
Full product description{item.omewoo.description.html}{this.omewoo.description.html}
Short product description{item.omewoo.description.shortHtml}{this.omewoo.description.shortHtml}
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.

The flat fields above are the released legacy lane and remain exact for backward compatibility. They preserve their existing raw values, positive discount representation, and missing-value-to-zero behavior. They are not silently reinterpreted for the store's shopper-facing tax presentation.

cartTotals.cartAmount

cartTotals.cartAmount is the additive canonical lane for OmeWooCartAmount. Its monetary values use Store API minor units and keep direct net and tax fields split:

ExpressionTypeMeaning
{cartTotals.cartAmount.total_items}stringItems subtotal excluding tax, in minor units.
{cartTotals.cartAmount.total_items_tax}stringTax paired with the items subtotal, in minor units.
{cartTotals.cartAmount.total_discount}stringDiscount excluding tax, in minor units. Cart Amount supplies the shopper-facing minus sign.
{cartTotals.cartAmount.total_discount_tax}stringTax paired with the discount, in minor units.
{cartTotals.cartAmount.total_fees}stringFees excluding tax, in minor units.
{cartTotals.cartAmount.total_fees_tax}stringTax paired with fees, in minor units.
{cartTotals.cartAmount.total_shipping}string or nullShipping excluding tax, in minor units. null while required shipping is unresolved.
{cartTotals.cartAmount.total_shipping_tax}string or nullTax paired with shipping, in minor units. null while required shipping is unresolved.
{cartTotals.cartAmount.total_tax}stringDirect WooCommerce tax total, in minor units.
{cartTotals.cartAmount.total_price}stringDirect WooCommerce final total, in minor units. It already contains applicable tax.
{cartTotals.cartAmount.needs_shipping}booleanWhether this cart requires shipping.
{cartTotals.cartAmount.has_calculated_shipping}booleanWhether WooCommerce has calculated shipping.
{cartTotals.cartAmount.tax_display}stringNormalized store cart presentation: including_tax or excluding_tax.
{cartTotals.cartAmount.currency_code}stringISO currency code.
{cartTotals.cartAmount.currency_symbol}stringDecoded currency symbol.
{cartTotals.cartAmount.currency_minor_unit}numberCurrency precision used to format minor-unit values.
{cartTotals.cartAmount.currency_decimal_separator}stringDecimal separator.
{cartTotals.cartAmount.currency_thousand_separator}stringThousands separator.
{cartTotals.cartAmount.currency_prefix}stringFormatted currency prefix.
{cartTotals.cartAmount.currency_suffix}stringFormatted currency suffix.

Cart Amount combines only the matching net/tax pairs for subtotal, discount, fees, and shipping. It reads total_tax and total_price directly and never reconstructs them. In particular, do not add tax to total_price.

A resolved total_shipping="0" means free shipping. Nullable shipping plus required, uncalculated shipping means pending; in that case the direct final total is exposed as estimated rather than guessing a shipping charge. Use OmeWooCartAmount instead of wiring these rules by hand.

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.