Product Icon

Conditional Content for WooCommerce

Show or hide store blocks and messages using WooCommerce cart, product, and customer rules. Cart messages can update on the same page.
Choose a billing option
$49
Save 20%
$98 $78.40

Subscription includes

  • Product updates and improvements
  • Customer support
  • 30-day money-back guarantee

Show the right message to the right shopper

Conditional Content for WooCommerce shows a message, a banner or a block when the rules you set match. Show a low-stock notice on a product page, a delivery note when certain items are in the cart, or a welcome-back offer for returning customers. Watch the short demo to see it in the editor and on the storefront.

A Notice with the Info tone under the price on a product page.

Rules for products, carts, customers, pages and dates

Each content block carries its own rules. Rules in the same rule group must all match. Add a second rule group to show the content when either group matches.

  • Product. Category, attribute, type, price, stock level, stock status, sale status and sale dates, plus brand on WooCommerce 9.6 or later.
  • Cart. Cart total, cart quantity, and the products and categories in the cart.
  • Customer. Role, user, order history, total spent and days since the last order.
  • Page. A specific page, a post type, and single or archive views.
  • Schedule. Date, day of the week and time of day, in your site’s timezone.
  • Geography. The shopper’s country and the active WPML language.

The Rules box with two rule groups: Role is Customer and Product Category in Hoodies, or Sale Status is On Sale.

Customer messaging in the cart

If your store already offers free shipping on orders of $100 or more, use a $100 cart rule to show a notice when the shopper qualifies. A message placed with the Conditional Content block, Display conditions or the shortcode appears or disappears without reloading the page as shoppers add or remove items or change quantities. This also works on cached pages.

On the classic cart page, choose a location WooCommerce redraws, such as Before cart table, and the message updates with the cart.

A Notice with the Success tone above the cart when the cart total is $100.

Show or hide blocks with Display conditions

Save a group of rules as a Condition Set, then choose it in the Display conditions panel of a block in the Site Editor or the post editor. The block shows when the set matches. Turn on Hide when matched to show the block to everyone else.

Apply one Condition Set to as many blocks as you like. Edit the set once and every block that uses it follows the updated rules.

The Site Editor with a sale banner in the header selected, and the Display conditions panel showing the Sale page condition set and the Hide when matched toggle.

Ready-made styles for store messages

Give a content block a Notice, Outline, Callout or Banner style. Pick a Neutral, Info, Success or Warning tone, or enter a custom color to match your brand. A live preview shows the result as you choose, and the message keeps its look wherever it appears.

Notice, Outline, Callout and Banner styles showing the same free shipping message.

Fits block themes, classic themes and page builders

  • Block themes. The Conditional Content block places a content block anywhere in the Site Editor, or on a page or post.
  • Classic themes. Choose a WooCommerce location on the product, shop, cart, checkout, order received or mini-cart view.
  • Page builders and widgets. Paste the content block’s shortcode into a shortcode widget, a text widget or the classic editor. The shortcode is tested in Elementor’s Shortcode widget.
  • Custom templates. Print a content block at any action your theme runs, or with a template tag.

Pairs with Dynamic Pricing

Give a content block the same rules as a Dynamic Pricing discount, such as the same role or product category, and shoppers see the offer message where the discount applies.

Built for developers who need to extend it

Register your own rule types and locations with filters. Ask a Condition Set from code with wccc_matches(), and print a content block from a template with woocommerce_conditional_content(). The documentation lists the hooks.

Requirements: WordPress 6.5 or later, WooCommerce 9.0 or later and PHP 7.4 or later.

Support tickets are answered by the Conditional Content developer.


Frequently asked questions

Does it work with block themes and classic themes?

Yes. On a block theme, place the Conditional Content block in the Site Editor or add Display conditions to a block already on the page. On a classic theme, choose a WooCommerce location on the product, shop, cart, checkout, order received or mini-cart view.

Can I show or hide a block that is already on my page?

Yes. Select the block, open the Display conditions panel and choose a Condition Set. The block shows when the set matches. Turn on Hide when matched to show it to everyone else.

Can I edit one rule and update several blocks?

Yes. Apply the same saved Condition Set to each block through Display conditions. Edit the set in one place and every block using it follows the updated rules.

Can I show a message when the cart reaches a total?

Yes. Use the Cart Total Monetary Amount rule, such as is greater or equal to 100. A message placed with the Conditional Content block, Display conditions or the shortcode appears as the shopper updates the cart, on the same page.

Can I show a cart message when a specific product is added?

Yes. Choose Cart Products, select the product, and set the rule to contains at least 1. Use Cart Categories to check for items from a particular category.

Can I show a block only to wholesale customers?

Yes. Create a Condition Set with the Role rule and select your wholesale role. Choose the set in the block's Display conditions panel to show the block to customers in that role.

Can I show content to returning customers?

Yes. Order Count and Status, Total Spent and Days Since Last Order read a logged-in customer's orders, and Ordered Product(s) checks what they bought. Welcome back a customer who has spent $100, or show a care guide to buyers of one product.

Can I show a low-stock or sale message on product pages?

Yes. Stock Level and Stock Status rules read the product's inventory, and Sale Status and Sale Date rules follow its sale schedule. Place the message after the price or after the add to cart button. Show it on shop tiles with a Custom Action or the Conditional Content block.

Can I schedule content for a date or time?

Yes. Date, Day and Time rules show content from a start date, until an end date, on chosen days of the week or after a time of day. They follow your site's timezone.

Can I combine several rules?

Yes. Rules in the same rule group must all match. Add another rule group to show the content when either group matches.

Can I style the message to match my store?

Yes. Choose a Notice, Outline, Callout or Banner style and a Neutral, Info, Success or Warning tone, or enter a custom color. A live preview shows the result, and the message keeps its look wherever it appears.

Does it work with page builders?

Yes. Every content block has a shortcode, such as [woocommerce_conditional_content id="123"]. Paste it into any shortcode widget, text widget or classic editor page. The shortcode is tested in Elementor's Shortcode widget.

Does it work with page caching?

Yes. Content with a cart rule, placed with the Conditional Content block, Display conditions or the shortcode, is decided for each shopper after the page loads, so it works on cached pages. All other content is decided when the server builds the page, and a cached page keeps that result until the cache refreshes. Caching plugins commonly serve the cart, the checkout and logged-in customers fresh.

Can I show content by country or language?

Yes. The Country rule uses WooCommerce geolocation, and the WPML Language Code rule follows the active WPML language.

Does it work with Dynamic Pricing?

Yes. Give a content block the same rules as a Dynamic Pricing discount, such as the same role or product category, and shoppers see the offer message where the discount applies.

Can developers extend it?

Yes. Register your own rule types and locations with filters, ask a Condition Set from code with wccc_matches(), and print a content block from a template with woocommerce_conditional_content(). See the documentation for the hooks.

What does it require?

WordPress 6.5 or later, WooCommerce 9.0 or later and PHP 7.4 or later.

How do I get help?

Questions before you buy go through the pre-sales form. After purchase, open a ticket from your WooCommerce.com account. Support tickets are answered by the Conditional Content developer.

Extension information

  • PHP version required: 7.4
  • Tested with WordPress: 7.1
  • Tested with WooCommerce: 11.3
  • Requires at least WordPress: 6.5
  • Requires at least WooCommerce: 9.0

Countries

  •  Worldwide

Related Products

Price $279 annually
Rated 3.9 out of 5 stars
Price $29 annually
Rated 3.7 out of 5 stars
Price $119 annually
Rated 3.5 out of 5 stars
Price $49 annually
Rated 2.7 out of 5 stars
Price $109 annually
Rated 4.6 out of 5 stars
Price $49 annually
Rated 3.9 out of 5 stars
Price $79 annually
Rated 3.4 out of 5 stars
Price $59 annually
Rated 3.1 out of 5 stars
Price $109 annually
Rated 2.8 out of 5 stars
Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.