Class: Spree::Promotion::Actions::CreateAdjustment
Instance Method Summary
collapse
Methods inherited from Base
page, spree_base_scopes
#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
Instance Method Details
#compute_amount(order) ⇒ Object
15
16
17
|
# File 'app/models/spree/promotion/actions/create_adjustment.rb', line 15
def compute_amount(order)
[(order.item_total + order.ship_total - order.shipping_discount), compute(order)].min * -1
end
|
10
11
12
13
|
# File 'app/models/spree/promotion/actions/create_adjustment.rb', line 10
def perform(options = {})
order = options[:order]
create_unique_adjustment(order, order)
end
|