Module: SpreeCmCommissioner::LineItemBundleable

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/spree_cm_commissioner/line_item_bundleable.rb

Overview

Groups add-on line items (sold via a ProductRelation) under the line item they were bought with.

Grouping is display-only: each child keeps its own price, quantity and adjustments, since promotions, tax, service fees, payouts, refunds and open-dated redemption all work per line item. relation_type is a snapshot of the ProductRelation type at purchase, so later edits to the relation don't change what the order sold.

Instance Method Summary collapse

Instance Method Details

#bundle_amount ⇒ Object



27
28
29
# File 'app/models/concerns/spree_cm_commissioner/line_item_bundleable.rb', line 27

def bundle_amount
  amount + children.sum(&:amount)
end