Conditional Content demos

Northfield Supply Co. is a demo store for Conditional Content for WooCommerce. Each card below is one feature: the steps to follow, what you should see, the rule behind it and a link to the page. The ringed box in each picture is the conditional message. Shipping is free, tax is off and checkout uses Cash on delivery.

Each demo page opens with a dashed Demo guide box. It says what to do and what shows. Every other box on the page belongs to the feature.

Cart rules

Demo 1

Content that follows the cart

  1. Open the Cast Iron Skillet and select Add to cart.
  2. Open the cart. The Demo guide says the cart is under $100.
  3. Set the quantity to 3.

You should see: a green panel that starts “Your order qualifies for free gift wrapping.” above the cart, with no reload. Set the quantity back to 2 and it leaves.

Rule: Cart Total Monetary Amount is greater or equal to 100.

The cart with the green gift wrapping message ringed above the cart table
The ringed green panel is the content block.

Demo 2

Category in the cart

  1. Open the cart and remove every item.
  2. Add a Soy Wax Candle and open the cart. No blue panel shows.
  3. Add a Ceramic Camp Mug and open the cart.

You should see: a blue panel that starts “Kitchen care guide.” above the cart.

Rule: Cart Categories contains at least 1 from Kitchen.

The cart with the blue Kitchen care guide message ringed above the cart table
The ringed blue panel is the content block.

Display conditions on any block

Demo 3

Show a block to one role

  1. Select Log out in the buttons above if it shows, then open Wholesale. The page has no price list.
  2. In the Demo guide, select Log in: Wholesale customer.

You should see: the Wholesale price list table appears below the Demo guide.

Rule: Condition set Wholesale customers: Role is Wholesale customer.

The Wholesale page with the price list ringed below the Demo guide
The ringed box is the price list Group block.

Demo 4

Hide when matched

  1. Select Log out in the buttons above if it shows, then open Customers. The Log in to your account box shows.
  2. In the Demo guide, select Log in: Wholesale customer.

You should see: the Log in to your account box is gone.

Rule: Condition set Logged-in customers: Authentication is Logged In, with Hide when matched.

The Customers page with the Log in to your account box ringed below the Demo guide
The ringed box is the Log in to your account Group block.

Demo 5

Customer history

  1. Open Customers and select Log in: Wholesale customer. This account has no orders and no Welcome back box shows.
  2. Select Log in: Returning customer. This account has one completed order of $200.

You should see: the Welcome back box appears below the Demo guide.

Rule: Condition set Returning customers: Total Spent is greater or equal to 100.

The Customers page with the Welcome back box ringed below the Demo guide
The ringed box is the Welcome back Group block.

Demo 6

A banner on one page

  1. Open Gift wrapping. The header has no banner.
  2. Open Shipping.

You should see: a dark banner under the header that reads “Free shipping on every order.”

Rule: Condition set Shipping page: Page is Shipping, on a Group block in the header template part.

The Shipping page with the dark banner ringed under the header
The ringed banner is a Group block in the header.

Product rules

Demo 7

Messages under the price

  1. Open the Soy Wax Candle. No message shows under the price. The product matches no rule.
  2. Open the Canvas Market Tote, the Brass Table Lamp and the Merino Wool Beanie.

You should see: one message under the price on each of the three: an indigo “On sale.” on the tote, an amber “Low stock.” on the lamp and an outlined “Fjord Wool Co.” note on the beanie.

Rule: Sale Status is On Sale. Stock Level is less or equal to 5 and greater than 0. Product Brand in Fjord Wool Co. Three content blocks sit under the price in the Single Product template.

The Canvas Market Tote page with the sale message ringed under the price
Canvas Market Tote: Sale Status is On Sale.
The Brass Table Lamp page with the low stock message ringed under the price
Brass Table Lamp: Stock Level is 3.
The Merino Wool Beanie page with the brand note ringed under the price
Merino Wool Beanie: Product Brand is Fjord Wool Co.

Shortcode

Demo 8

Place a content block with its shortcode

  1. Open the cart and remove every item.
  2. Open Gift wrapping. The message is hidden while the cart is under $100.
  3. Add 3 Cast Iron Skillets to the cart, then return to Gift wrapping.

You should see: the green gift wrapping panel below the Demo guide.

Rule: The Free gift wrapping content block, placed with its shortcode: Cart Total Monetary Amount is greater or equal to 100.

The Gift wrapping page with the green gift wrapping message ringed below the Demo guide
The ringed panel is placed by the shortcode.

Store administrators manage the content blocks at WooCommerce, Content Blocks and the condition sets at WooCommerce, Condition Sets.