Guide
Shopware 6 Dynamic Pricing: Rule Builder vs Custom Plugin
Guide comparing Shopware Rule Builder and custom plugin for customer‑group pricing, with a concrete rule example and validation steps.
Published by Tasadduq Burney
16 Apr 2026, 12:32 UTC
2 min55K views0

Decision: implement dynamic pricing based on customer group and cart total
The store needs a price that changes for wholesale customers when the cart exceeds a certain amount. The solution must be maintainable without frequent code changes, work with Shopware 6.5 or newer, and add minimal overhead to cart calculation.
Supported options
| Option | How it works | Where to configure |
|---|---|---|
| Rule Builder | Define conditions and actions through the admin UI; Shopware evaluates the rule during cart price calculation. | Settings › Rule Builder › Create rule |
| Custom plugin | PHP class that listens to the CartPriceCalculationEvent and modifies line item prices programmatically. | Custom plugin in custom/plugins/; activate via admin or CLI. |
Trade‑offs
- Rule Builder: zero‑code, fast iteration, visible to non‑developers. Limited to actions exposed by core (e.g., fixed price, percentage discount, free shipping). Adding many rules can increase cart calculation time.
- Custom plugin: full flexibility to implement any pricing formula, access to services and repositories. Requires development effort, version‑specific testing, and maintenance when core events change.
Concrete implementation – Rule Builder
Example: set a fixed price of €19.99 for product SKU ABC-123 when the customer belongs to the WHOLESALE group.
- Log in to the Shopware admin.
- Navigate to Settings › Rule Builder and click Create rule.
- Name the rule Wholesale fixed price ABC-123.
- Add condition: Customer group equals WHOLESALE.
- Add action: Set price → value
19.99, currencyEUR, apply to Specific products → select SKUABC-123. - Save and activate the rule.
Validation steps
- Create a test customer and assign them to the WHOLESALE group.
- Log in as that customer (or impersonate via admin).
- Add product
ABC-123to the cart. - Observe the cart line price: it should display €19.99 regardless of the product’s base price.
- Log out or switch to a regular customer; the same product should show its default price.
- Optional: run a Symfony test asserting the cart total for both scenarios.
Limitations and practical checks
- If the required action (e.g., a tiered discount based on cart total) is not available in Rule Builder, a custom plugin is necessary.
- Performance: keep the number of active rules under a few dozen; monitor cart calculation time with the Shopware profiler (
php bin/console server:profile) to ensure latency stays acceptable. - Future Shopware updates may rename or remove rule conditions/actions. After each minor version upgrade, revisit Settings › Rule Builder to confirm the rule still appears and functions.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.