Class: Spree::Calculator::FlatFee

Inherits:
Calculator
  • Object
show all
Defined in:
app/models/spree/calculator/flat_fee.rb

Overview

Very simple tax rate calculator. Can be used to apply a flat fee to any type of item, including an order.

Instance Method Summary collapse

Instance Method Details

#compute(_object) ⇒ Object Also known as: compute_order, compute_shipment, compute_line_item, compute_shipping_rate

Amount is fixed regardles of what it's being applied to.



12
13
14
# File 'app/models/spree/calculator/flat_fee.rb', line 12

def compute(_object)
  rate.active? ? rate.amount : 0
end