Skip to main content
Version: 2.0.0

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.

How prices are applied

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

ModeKeyDescriptionExample (€100 product)
Percentage offby_percentSubtract a % from the original price20% off → €80
Fixed amount offby_fixedSubtract a fixed amount from the original price€15 off → €85
Set to % of originalto_percentSet the price to a % of the original75% → €75
Set to fixed priceto_fixedOverride the price with a specific valueSet to €49

Rule fields

FieldDescription
NameInternal label — not shown to customers
DescriptionOptional note (max 50 characters)
Action typeOne of the four calculation modes
AmountThe discount value — percent or monetary
PriorityHigher value = evaluated first when multiple rules match the same product
Discard subsequent rulesWhen enabled, stops lower-priority rules from applying to the same products
Customer groupsRestrict the discounted price to specific groups; leave blank for all customers
Valid from / Valid toDate window; leave either blank for open-ended
SiteWhich site(s) the rule applies to in a multi-site store
EnabledToggle 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
Rules with no conditions

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:

RulePriorityDiscard subsequentResult on €100 product
Summer Sale 20%100Yes→ €80. No further rules apply
Category 10%50NoSkipped — Priority 100 discarded it
Loyalty group €5 off10NoSkipped — Priority 100 discarded it

Creating a catalog price rule

  1. Go to yStore → Marketing → Catalog Price Rules.
  2. Click New Catalog Rule.
  3. Enter a name and optional description.
  4. Select the action type and enter the discount amount.
  5. Set priority relative to other active rules.
  6. Optionally restrict to customer groups or set a date window.
  7. Open the Conditions tab and add product filters.
  8. Enable the rule and Save.
  9. 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
Verify in the storefront

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

FeatureCatalog RulesCoupons
Requires a code?No — automaticYes — entered at checkout
When price showsOn product listing/detail pagesOnly after code is applied at checkout
Stackable with each other?Via priority and discard logicVia stacking and exclusivity settings
Can be combined?Yes — catalog rule + coupon both applyYes — independent systems
Targeted by customer group?YesYes
Targeted by date?YesYes

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

PromotionSetup
Site-wide 10% Summer SaleNo conditions, by_percent 10%, date window
VIP member priceCustomer group: VIP, by_fixed or to_fixed
Category clearanceCondition: category = "Clearance", by_percent 30%
Flash sale on specific SKUsCondition: SKU in list, to_fixed price, 24h date window
B2B wholesale pricingCustomer group: Wholesale, to_percent 70% of retail