Example: Reserve Low Stock for Loyal Customers
In this guide, we will reserve products with Low Stock so they are ONLY available to customers who have purchased from us before.
Step-by-Step Configuration
-
Create a New Rule
Go to Settings > Product Visibility > Rules and click Add Rule.
-
Set General Info
Title: Low Stock for Loyal Customers
Enabled: Yes -
Define What to Hide (Scarce Items)
We want to apply this to ALL Products, but only when they are low on stock.
Filter Type: All Products
Filter Value: (Leave empty / All) -
Choose "Show" (Whitelist)
We want to ensure that IF stock is low, ONLY the following people can see it.
Visibility Action: Show (Whitelist)
-
Add Condition 1: The Trigger (Low Stock)
We only want this rule to kick in when stock is low.
Condition Type: Stock Status
Operator: Is
Value: Low Stock(Make sure you have managed stock enabled in WooCommerce for this to work effectively).
-
Add Condition 2: The Audience (Loyal Customers)
Who is allowed to buy low stock items? Anyone who has made at least one purchase.
Condition Type: Has Purchased (Any Product)
Operator: True (Has orders)Alternatively, you could use "User Role" = Customer.
-
Important: Logical Logic
Wait! If we just list both conditions, Yeekit typically requires ALL conditions to match for the "Show" action.
However, "Stock Status" works as a property of the product.
So the logic becomes: Is the product Low Stock? AND Is the User a Buyer? -> Then SHOW.But what if the product is In Stock? It won't match the "Low Stock" condition. If it doesn't match, the "Show" rule fails, and the product gets HIDDEN for everyone!
CRITICAL TIP: To make this logic work perfectly (Hide ONLY if low stock AND not loyal), it is often easier to use the HIDE Action with Negative Logic. -
Let's Refine the Strategy (The "Hide" Approach)
Let's flip it. We want to HIDE products IF they are Low Stock AND the user has NOT purchased before.
Action: Hide Completely
Condition 1:
Type: Stock Status
Value: Low StockCondition 2:
Type: Has Purchased (Any)
Operator: FALSE (Has NOT purchased) -
Save the Rule
Click Save Rule.
Result
- Product In Stock: Visible to everyone (Rule doesn't trigger Condition 1).
- Product Low Stock + New User: Matches both conditions -> HIDDEN.
- Product Low Stock + Loyal Customer: Fails Condition 2 -> VISIBLE.