Catalog Price Rules
Navigate to yStore → Marketing → Catalog Price Rules.
Catalog price rules reduce product prices automatically across the catalog — based on conditions you define. Unlike coupons, customers do not need to enter a code. The discounted price is calculated in advance, stored in the database, and displayed on product listing and detail pages before the item is even added to the cart.
Rule prices are pre-computed and cached in the database by a background job. They are not calculated on the fly at page load. This means they are fast and don't require any extra queries at display time — but changes take effect after the next job run, not instantly.
Price calculation modes
| Mode | Key | Description | Example (€100 product) |
|---|---|---|---|
| Percentage off | by_percent | Subtract a % from the original price | 20% off → €80 |
| Fixed amount off | by_fixed | Subtract a fixed amount from the original price | €15 off → €85 |
| Set to % of original | to_percent | Set the price to a % of the original | 75% → €75 |
| Set to fixed price | to_fixed | Override the price with a specific value | Set to €49 |
Rule fields
| Field | Description |
|---|---|
| Name | Internal label — not shown to customers |
| Description | Optional note (max 50 characters) |
| Action type | One of the four calculation modes |
| Amount | The discount value — percent or monetary |
| Priority | Higher value = evaluated first when multiple rules match the same product |
| Discard subsequent rules | When enabled, stops lower-priority rules from applying to the same products |
| Customer groups | Restrict the discounted price to specific groups; leave blank for all customers |
| Valid from / Valid to | Date window; leave either blank for open-ended |
| Site | Which site(s) the rule applies to in a multi-site store |
| Enabled | Toggle to activate or deactivate without deleting |
Targeting products with conditions
The Conditions tab uses Craft's native condition builder to filter which products the rule applies to. You can target by:
- Category
- Product title, handle, or SKU
- Price range
- Stock level
- Any custom field on the Product element
A rule with no conditions configured matches every product in the catalog. This is intentional for store-wide sales, but easy to do accidentally. Always review the conditions tab before enabling a rule.
Priority and rule stacking
When multiple active rules could apply to the same product, priority determines the order of evaluation.
Discard subsequent rules: When this is enabled on a rule, no lower-priority rules run for products that match this rule — even if those products would otherwise qualify for those lower rules. Use this for high-value campaigns that should not stack with everyday promotions.
Example:
| Rule | Priority | Discard subsequent | Result on €100 product |
|---|---|---|---|
| Summer Sale 20% | 100 | Yes | → €80. No further rules apply |
| Category 10% | 50 | No | Skipped — Priority 100 discarded it |
| Loyalty group €5 off | 10 | No | Skipped — Priority 100 discarded it |
Creating a catalog price rule
- Go to
yStore → Marketing → Catalog Price Rules. - Click New Catalog Rule.
- Enter a name and optional description.
- Select the action type and enter the discount amount.
- Set priority relative to other active rules.
- Optionally restrict to customer groups or set a date window.
- Open the Conditions tab and add product filters.
- Enable the rule and Save.
- Apply immediately with the CLI, or wait for the next CRON cycle.
Applying rules
Rules are recalculated automatically on each CRON run. To force immediate recalculation:
# Apply all active rules to the catalog
php craft yui/catalog-rule/apply
# Reset all rule-computed prices and rebuild from scratch
php craft yui/catalog-rule/reset
# Apply a specific rule by ID
php craft yui/catalog-rule/apply --id=12
After applying a rule, open the product detail page while logged in as a customer in the targeted group. The discounted price should appear before the item is added to the cart. If it doesn't, check whether the CRON/queue has processed the job and confirm the customer's group matches the rule's group restriction.
Catalog rules vs. coupons
| Feature | Catalog Rules | Coupons |
|---|---|---|
| Requires a code? | No — automatic | Yes — entered at checkout |
| When price shows | On product listing/detail pages | Only after code is applied at checkout |
| Stackable with each other? | Via priority and discard logic | Via stacking and exclusivity settings |
| Can be combined? | Yes — catalog rule + coupon both apply | Yes — independent systems |
| Targeted by customer group? | Yes | Yes |
| Targeted by date? | Yes | Yes |
Catalog rules change the displayed product price. Coupons apply an additional discount at checkout on top of that price. Both can be active at the same time and both apply to the same order independently.
To make a catalog promotion exclusive (not stackable with coupon codes), restrict the rule to a specific customer group and ensure active coupons either exclude that group or have exclusivity enabled.
Common use cases
| Promotion | Setup |
|---|---|
| Site-wide 10% Summer Sale | No conditions, by_percent 10%, date window |
| VIP member price | Customer group: VIP, by_fixed or to_fixed |
| Category clearance | Condition: category = "Clearance", by_percent 30% |
| Flash sale on specific SKUs | Condition: SKU in list, to_fixed price, 24h date window |
| B2B wholesale pricing | Customer group: Wholesale, to_percent 70% of retail |