NO BUG: {woo_product_stock} and Product Stock element return parent stock instead of selected variation stock

Hi Bricks team,

I found another inconsistency with WooCommerce variable products that seems very similar to the recently fixed SKU issue:

https://forum.bricksbuilder.io/t/solved-dynamic-data-woo-product-sku-returns-parent-sku-instead-of-variation-sku/39609

The Product Stock element and the {woo_product_stock} dynamic data currently return the parent product stock (the summed stock across all variations), even when a variation is selected.

For example:

  • Red: 1 in stock

  • Gree: 1 in stock

{woo_product_stock} returns:

2

for the currently selected variation.

Since the selected variation already defines the active product context (price, SKU, availability, etc.), I would expect the stock value to behave the same way and return the stock quantity of the selected variation instead of the summed parent stock.

This seems inconsistent with WooCommerce’s default behavior and with the recently fixed {woo_product_sku} issue.

Additionally, the Bricks Cart element already behaves correctly. It displays the stock quantity of the currently selected variation instead of the summed parent stock.

For consistency, I would expect the Product Stock element and {woo_product_stock} dynamic data to use the same logic.

Is this a bug?

Hi @stabilo ,

Thanks for the report. This is expected behavior.

WooCommerce displays the selected variation’s stock and availability inside the variable product Add to Cart form. The standalone Product Stock element and {woo_product_stock} continue to represent the parent variable product, for which Bricks returns the summed stock across the available variations.

The SKU case is different because WooCommerce natively updates the product-meta SKU when a variation is selected. Likewise, cart items already have a specific variation context.
To display the selected variation’s stock, please use the availability output provided by the Add to Cart element.

Regards,
Jenn