Class: SolidusFriendlyPromotions::Benefits::AdjustLineItem

Inherits:
SolidusFriendlyPromotions::Benefit show all
Defined in:
app/models/solidus_friendly_promotions/benefits/adjust_line_item.rb

Direct Known Subclasses

AdjustLineItemQuantityGroups

Instance Method Summary collapse

Methods inherited from SolidusFriendlyPromotions::Benefit

#adjustment_label, #applicable_line_items, #available_calculators, #available_conditions, #compute_amount, #discount, #eligible_by_applicable_conditions?, #preload_relations, #to_partial_path

Instance Method Details

#can_discount?(object) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'app/models/solidus_friendly_promotions/benefits/adjust_line_item.rb', line 6

def can_discount?(object)
  object.is_a? Spree::LineItem
end

#levelObject



10
11
12
# File 'app/models/solidus_friendly_promotions/benefits/adjust_line_item.rb', line 10

def level
  :line_item
end

#possible_conditionsObject



14
15
16
# File 'app/models/solidus_friendly_promotions/benefits/adjust_line_item.rb', line 14

def possible_conditions
  super + SolidusFriendlyPromotions.config.line_item_conditions
end