Blog Sections Open

Implementing Quantity-Based Discounts Per Product in Shopkeeper

Tiered discounts become much easier when the pricing rules belong to the product model itself instead of being scattered across templates and cart JavaScript.

If one product should receive a discount only after the customer buys a certain quantity of that same product, the discount logic needs to live close to the cart calculation layer. Simple visual hints in the template are not enough.

What the rule really needs

  • a per-product threshold model
  • a way to inspect the cart quantity for that exact item
  • a recalculation step that updates the effective price or discount line

For maintainability, treat tiered pricing as structured business logic. Store the thresholds in TVs, a helper table, or another product data source, then calculate the discount during cart recalculation rather than hardcoding it in presentation markup.

Newer post

Creating Resources from eForm Data in Evolution CMS

How to turn an eForm submission into a newly created resource instead of just sending an email.

Older post

Why getResources Can Keep Outputting Fields from the Current Page Instead of the Requested Resource

How to avoid template-field confusion when getResources is asked to render data from a specific resource.