WooCommerce Product Data
Use UiChemy's WooCommerce dynamic tags and the product Twig provider to build custom product pages, product cards, and shop templates.
UiChemy adds a full set of WooCommerce dynamic tags for binding product data to Elementor widget controls without code, plus a product Twig provider for outputting any product field directly in a Composer widget's HTML.
WooCommerce integration requires WooCommerce to be installed and active, plus UiChemy Pro. The product Twig provider and WooCommerce dynamic tags are only available when WooCommerce is active.
WooCommerce Dynamic Tags
Dynamic tags let you bind product data to any Elementor widget control that supports dynamic content, no code needed. In the Elementor panel, look for the dynamic tag icon on a field, click it, and choose from the WooCommerce group.
Text tags:
| Tag | What it outputs |
|---|---|
| Product Title | Product name |
| Product ID | Numeric product ID |
| Product SKU | Product SKU string |
| Product Price | Formatted price HTML (auto, regular, or sale) |
| Stock Status | "In stock", "Out of stock", or "On backorder" |
| Stock Quantity | Number of items in stock |
| Product Type | simple, variable, grouped, external |
| Average Rating | Numeric rating (e.g. 4.5) |
| Sale Badge | Outputs the sale text (default: "Sale!") only if the product is on sale |
| Short Description | Product short description (HTML) |
| Description | Product full description (HTML) |
| Product Categories | Comma-separated category list with links |
| Product Tags | Comma-separated tag list with links |
| Product Attribute | Value of a specific product attribute |
| Purchase Note | Purchase note text |
| Product Slug | URL slug |
URL tags:
| Tag | What it outputs |
|---|---|
| Product URL | Permalink to the product page |
| Add to Cart URL | Direct add-to-cart URL (variable products redirect to the product page) |
| Checkout URL | WooCommerce checkout page URL |
| Back to Shop URL | WooCommerce shop page URL |
Image tags:
| Tag | What it outputs |
|---|---|
| Product Featured Image | Product featured image |
| Product Gallery Image | A specific image from the product gallery by index (0 = first) |
The product Twig Provider
Inside a Composer widget's HTML panel, the product provider gives you direct access to every field of the current product:
<article class="product-card">
<div class="product-image">
<img
src="{{ product.thumbnail.src('woocommerce_thumbnail') }}"
alt="{{ product.thumbnail.alt }}"
>
{% if product.is_on_sale %}
<span class="sale-badge">Sale</span>
{% endif %}
</div>
<div class="product-body">
<h2 class="text-heading-h3">{{ product.title }}</h2>
<p class="product-cats">{{ product.categories.name }}</p>
<div class="product-price">{{ product.price|raw }}</div>
{% if product.is_in_stock %}
<a href="{{ product.add_to_cart_url }}" class="btn-primary">Add to Cart</a>
{% else %}
<span class="out-of-stock">Out of Stock</span>
{% endif %}
</div>
</article>
All product fields:
| Expression | Output |
|---|---|
product.title | Product name |
product.id | Numeric ID |
product.slug | URL slug |
product.link | Permalink |
product.price | Formatted price HTML, use |raw |
product.regular_price | Regular price (raw number) |
product.sale_price | Sale price (raw number) |
product.is_on_sale | Boolean |
product.sku | SKU string |
product.stock_status | instock, outofstock, onbackorder |
product.stock_quantity | Integer or empty |
product.is_in_stock | Boolean |
product.add_to_cart_url | Add-to-cart URL |
product.average_rating | Number (e.g. 4.5) |
product.review_count | Integer |
product.short_description | Short description HTML, use |raw |
product.description | Full description HTML, use |raw |
product.thumbnail.src | Featured image URL (full size) |
product.thumbnail.src('medium') | Featured image at a specific size |
product.thumbnail.alt | Featured image alt text |
product.meta('key') | Custom field / product meta value |
product.currency / product.currency_symbol | Store currency code and symbol |
product.sale_percentage | Discount percentage while on sale |
product.is_featured / is_downloadable / is_virtual | Boolean product flags |
product.total_sales | Number of units sold |
product.categories / product.tags / product.brand | Taxonomy terms assigned to the product |
product.attribute('name') / product.attributes | A specific attribute value, or all of them |
product.weight / dimensions | Shipping weight and dimensions |
product.related() / upsells / cross_sells | Related product collections |
product.variations | Variation data for variable products |
product.gallery | The product's image gallery |
This list covers the most commonly used fields. The product provider exposes considerably more of WooCommerce's product data than fits here, if a field exists on a WooCommerce product, there's usually a matching product.* expression for it.
Building a Product Listing With Loops
Use get_products() in a {% for %} loop to build a dynamic product grid:
<div class="uc-grid-3">
{% for product in get_products({
posts_per_page: 9,
orderby: 'date',
order: 'DESC'
}) %}
<article class="uc-blog-card product-card">
<a href="{{ product.link }}">
<img
src="{{ product.thumbnail.src('woocommerce_thumbnail') }}"
alt="{{ product.thumbnail.alt }}"
>
</a>
<div class="card-body">
{% if product.is_on_sale %}
<span class="text-label" style="color: var(--color-brand)">Sale</span>
{% endif %}
<h3 class="text-heading-h4">{{ product.title }}</h3>
<div class="product-price">{{ product.price|raw }}</div>
<a href="{{ product.add_to_cart_url }}" class="btn">Add to Cart</a>
</div>
</article>
{% endfor %}
</div>
Filter by category:
{% for product in get_products({
posts_per_page: 6,
tax_query: [{
taxonomy: 'product_cat',
field: 'slug',
terms: ['featured']
}]
}) %}
Filter to featured and in-stock only:
{% for product in get_products({
posts_per_page: 8,
meta_key: '_featured',
meta_value: 'yes',
meta_query: [{
key: '_stock_status',
value: 'instock'
}]
}) %}
Theme Builder and WooCommerce
When building WooCommerce Theme Builder templates, Single Product and Products Archive, the product Twig provider automatically resolves to the correct product in context:
- On a Single Product template:
productis that product. - Inside a product loop (
get_products):productis the loop variable. - On a Products Archive template:
productresolves per item in loop context.
Cart and checkout pages aren't Theme Builder template types, they render WooCommerce's own output. The product provider and dynamic tags above are for product and shop display; use the Checkout URL and Add to Cart URL tags to link to those pages.
Style Cart, Checkout, and Account Pages With Woo Tags
Cart, checkout, and My Account pages run WooCommerce's own purchase flow, so UiChemy never replaces them. Instead, you design the layout around them and drop in a Woo tag where WooCommerce's part should appear. Your store keeps taking orders, and the page still looks like the rest of your site.
Add a tag in your section's HTML, for example <uichemy-woo-cart />:
| Tag | What it shows |
|---|---|
<uichemy-woo-cart /> | The cart |
<uichemy-woo-checkout /> | The checkout, including the thank-you view after an order |
<uichemy-woo-my-account /> | The customer's account area |
<uichemy-woo-order-tracking /> | The order tracking form |
<uichemy-woo-notices /> | WooCommerce messages, like coupon errors or a declined payment |
<uichemy-woo-add-to-cart /> | The add-to-cart form for the product in view. Add id="123" for a specific product. |
<uichemy-woo-reviews /> | WooCommerce's review list and review form |
<uichemy-woo-mini-cart /> | The mini cart |
<uichemy-woo-thankyou /> | WooCommerce's order confirmation block. It fires the thank-you hook that carries payment instructions, gateway confirmations, and conversion pixels, so keep it on any Order received template |
Two tags you shouldn't skip. Add <uichemy-woo-notices /> to any custom cart or checkout layout, or shoppers won't see errors like a declined card. On a custom Single Product template, use <uichemy-woo-add-to-cart /> for the buy button: it's the only way a variable product (sizes, colours) can be added to the cart.
In the editor, these tags show a labelled placeholder instead of a live cart, because a real cart needs a shopper's session. Check the live page to see the real thing.
Cart, Orders, and Reviews as Data (Pro)
With UiChemy Pro, you can design these parts yourself in Twig instead of using WooCommerce's default look.
Cart (cart) works on every page, so it's perfect for a header cart badge, a mini-cart panel, or a free-shipping bar. When there's no shopper session (for example in the editor), it reports an empty cart.
| Field | Returns |
|---|---|
cart.count, cart.lines | Number of items, and number of different lines |
cart.is_empty | true when the cart is empty |
cart.items | Each line, with product, quantity, variation, line_total, and remove_url |
cart.total, cart.subtotal | Totals, formatted. Add _raw (for example cart.total_raw) for the plain number. |
cart.coupons | Applied coupon codes |
cart.free_shipping_min, cart.free_shipping_remaining, cart.free_shipping_progress | The free-shipping threshold, how much is left, and progress from 0 to 100 |
cart.url, cart.checkout_url, cart.shop_url | Links to the cart, checkout, and shop |
{% if cart.free_shipping_min > 0 %}
<div class="ship-bar"><span style="width: {{ cart.free_shipping_progress }}%"></span></div>
<p>{{ cart.free_shipping_remaining }} away from free shipping</p>
{% endif %}
Order (order) is the receipt on an Order Received template: order.number, order.status_label, order.date, order.items, order.total, and more. It's only shown to the shopper who placed the order, so it can't leak someone else's details.
Reviews come from product.reviews, or get_comments({ post_id: product.id, min_rating: 4 }) for a filtered list. Each review has author, rating, rating_html, content, verified, date, and avatar. To also let shoppers write a review, add <uichemy-woo-reviews />.
Shop Filters and Sorting (Pro)
Build a filter sidebar, price slider, and sort menu right in your product listing. Everything is a normal URL, so filtered pages can be shared and bookmarked.
| Function | What it does |
|---|---|
filter_url({ color: 'red' }) | A link that applies a filter. An empty value removes it, so the same function clears, resets, and sorts. |
get_filter_terms({ taxonomy: 'pa_color' }) | The terms for a filter, each with name, slug, count, active, and url. Counts respect the other active filters. |
price_range() | The lowest and highest price (min, max), for slider bounds |
Read the visitor's choice with request.get('color') and pass it to get_products() as a tax_query or meta_query.
To update the results without a full page reload, give each area an id and add data-uich-filter="#results,#filters" to the filter form or link. Include the sidebar too, so its counts and active states stay in sync. A reset link uses data-uich-filter-reset="color,size". If anything goes wrong, it falls back to a normal page load.
Frequently Asked Questions
Related
Dynamic Content Overview
See how WooCommerce data fits among the other data options.
Twig
See the full expression syntax product data is built on.
Loops
Build a product grid with get_products.
Dynamic Tags
Bind a single product field with no code.
WooCommerce Theme Builder Templates
See product data powering a real WooCommerce template.