SpreeOrderTotalDiscount

spree_order_total_discount adds a promotion calculator that takes a percentage off the true order total — the amount a customer actually pays, including option fees and other line-item adjustments.

Why this exists

Spree's built-in FlatPercentItemTotal calculates against item_total, which is the sum of line item prices before adjustments. If your store adds option fees on top of a variant's price, a "10% off" promotion built on the stock calculator quietly discounts less than customers expect.

Spree::Calculator::FlatPercentOrderTotal calculates against the order total instead, so the discount matches what the customer sees.

Features

  • Spree::Calculator::FlatPercentOrderTotal — percentage discount on the real order total
  • Selectable from the Spree admin like any other promotion calculator

Installation

Add this line to your application's Gemfile:

gem 'spree_order_total_discount'

Then run:

bundle install

Usage

Create a promotion in the Spree admin, add the action Create adjustment, and choose Flat percent (order total) as the calculator. Set the percentage as usual.

Requirements

  • Spree 5.3.6

Licence

AGPL-3.0-or-later. See LICENSE.