Skip to main content
Documentation/WooCommerce/Dynamic Data & Templating/Conditions

Conditions

WooCommerce conditions test product, cart, and customer data. See Element Display Conditions for adding a condition.

Product

Stock status

Checks the current product’s stock status.

  • Operands — is one of, is none of.
  • Values — In stock, Out of stock, On backorder.

Stock quantity

Compares the current product’s tracked inventory quantity with a number.

  • Operands — is, is not, is greater than, is less than.
  • Values — A stock quantity.

Virtual

Checks whether the product is virtual.

  • Operands — is.
  • Values — virtual or not virtual.

Downloadable

Checks whether the product is downloadable.

  • Operands — is.
  • Values — downloadable or not downloadable.

Cart

Checks whether the current product is in the visitor’s cart.

  • Operands — is.
  • Values — in cart or not in cart.

Attributes

Checks the attributes assigned to the current product.

  • Operands — is one of, is none of, is all of.
  • Values — Select product attribute values defined in your store.

is one of matches any selected value, is none of excludes all selected values, and is all of requires every selected value.

Width

Compares the product’s width with a number.

  • Operands — is, is not, is greater than, is less than.
  • Values — A number in the store’s dimension unit.

Height

Compares the product’s height with a number.

  • Operands — is, is not, is greater than, is less than.
  • Values — A number in the store’s dimension unit.

Length

Compares the product’s length with a number.

  • Operands — is, is not, is greater than, is less than.
  • Values — A number in the store’s dimension unit.

Weight

Compares the product’s weight with a number.

  • Operands — is, is not, is greater than, is less than.
  • Values — A number in the store’s weight unit.

Price

Compares the product’s price with a number.

  • Operands — is, is greater than, is less than.
  • Values — An amount in the store’s currency.

On Sale

Checks whether the product is on sale.

  • Operands — is.
  • Values — on sale or not on sale.

Tax Status

Checks how tax applies to the product.

  • Operands — is one of, is none of.
  • Values — Taxable, Shipping only, None.

Tax Class

Checks the product’s tax class.

  • Operands — is one of, is none of.
  • Values — The store’s tax classes, such as Standard, Reduced rate, or Zero rate.

Shipping Class

Checks the product’s shipping class.

  • Operands — is one of, is none of, is all of.
  • Values — Shipping classes configured in your store.

is one of matches any selected value, is none of excludes all selected values, and is all of requires every selected value.

Tags

Checks the tags assigned to the product.

  • Operands — is one of, is none of, is all of.
  • Values — Product tags configured in your store.

is one of matches any selected value, is none of excludes all selected values, and is all of requires every selected value.

Categories

Checks the categories assigned to the product.

  • Operands — is one of, is none of, is all of.
  • Values — Product categories configured in your store.

is one of matches any selected value, is none of excludes all selected values, and is all of requires every selected value.

Cart

Cart Quantity

Counts the product quantities in the visitor’s cart; three units of one product count as three.

  • Operands — is, is not, is greater than, is less than.
  • Values — A number of items.

Cart Value

Compares WooCommerce’s calculated cart total with an amount.

  • Operands — is, is not, is greater than, is less than.
  • Values — An amount in the store’s currency.

Cart Weight

Compares the weight of the products in the visitor’s cart with a number.

  • Operands — is, is not, is greater than, is less than.
  • Values — A number in the store’s weight unit.

Customer

Order Count

Checks WooCommerce’s recorded order count for the logged-in customer.

  • Operands — is, is not, is greater than, is less than.
  • Values — A number of orders.

This condition does not match logged-out visitors.

Total Spend

Checks WooCommerce’s recorded spending for the logged-in customer.

  • Operands — is, is not, is greater than, is less than.
  • Values — An amount in the store’s currency.

This condition does not match logged-out visitors.

Purchased Product

Checks the logged-in customer’s purchase history for selected products.

  • Operands — is one of, is none of, is all of.
  • Values — Choose products, or Current Product to follow the product being viewed or repeated in a loop.

is one of matches any selected value, is none of excludes all selected values, and is all of requires every selected value.

This condition does not match logged-out visitors.

Product and Archive Targeting

Product

Checks whether the current item is a selected product.

  • Operands — is, is not.
  • Values — Products from your store.

Product Parent

Checks the current product’s parent relationship.

  • Operands — is one of, is none of.
  • Values — Parent products from your store.

Is Taxonomy

Checks which product category or tag archive is being viewed. Use it with Specific Product Archive.

  • Operands — is, is not.
  • Values — Product category or tag terms.