WooCommerce Conditional Tags

Conditional tags are PHP functions that return true or false for the current request. Use them to check which WooCommerce page a visitor is viewing.

Six useful conditional tags

Function Returns true when Useful detail
is_shop() The main shop archive is displayed. Not a test for every WooCommerce page.
is_product() A single product page is displayed. Does not match the shop or product category archives.
is_product_category() A product category archive is displayed. Pass a category slug, such as 'shirts', to check one category.
is_cart() The configured cart page is displayed. Checks page context, not whether the cart has items.
is_checkout() The checkout page is displayed. Checks page context, not whether an order was completed.
is_account_page() A WooCommerce My Account page is displayed. Use endpoint checks when a particular account view matters.

Timing and common mistakes

For the full function list and details, see the official WooCommerce conditional tags reference. Return to the WooCommerce developer reference for other categories.