Pricing Rules Relationship icon

Pricing Rules Relationship

Plugin screenshot thumbnail 1/5
Plugin screenshot thumbnail 2/5
Plugin screenshot thumbnail 3/5
Plugin screenshot thumbnail 4/5
Plugin screenshot thumbnail 5/5

Pricing Rules Relationship fills a gap in Craft Commerce. Commerce gives you catalog pricing rules for your sales and discounts, and Craft gives you relationships between elements, but there's no built-in way to tie the two together. This plugin does exactly that.

Add the field to any element (an entry, a product, a category, whatever you're working with) and you get a plain checkbox list of your store's active pricing rules. Tick the ones you want. Then, in your templates, call craft.pricingRulesRelationship.getSaleIds() and you get back the IDs of every product those rules apply to, ready to drop into a product query.

It's percect for the kind of thing clients always ask for: a Special Offers page that only shows what's actually on sale, offer categories like "July Offers" or "Autumn Sale", or a landing page tied to one promotion, without anyone hand-picking products or keeping them up to date.

The plugin keeps itself honest, too. Expired rules drop out of your templates on their own, so nobody has to remember to untick anything. Disabled rules and rules that haven't started yet stay out of the way until they're live. Rules scoped to a customer group only ever return their products to people in that group, so nothing leaks across groups. And if you'd rather leave out-of-stock products off the list, that's a single flag.

Features

  • Relate Commerce catalog pricing rules to entries, products, categories, or any custom element
  • A plain checkbox field, no fuss for your editors
  • Expired, disabled and not-yet-started rules are handled for you
  • Respects customer-group scoping, with no cross-group leaks
  • Optional in-stock-only filtering
  • A "New Catalog Pricing Rule" button to jump straight into Commerce
  • One Twig call hands you the matching product IDs for your queries
Installation Instructions

To install this plugin, copy the command above to your terminal.

Reviews

This plugin doesn't have any reviews.

Active Installs
1
Version
1.0.3
License
MIT
Compatibility
Craft 5
Last release
July 5, 2026
Activity (30 days)
0
Closed Issues
0
Open Issues
0
Merged PRs
0
Open PRs