Class: SolidusPromotions::Conditions::PriceOptionValue
- Inherits:
-
SolidusPromotions::Condition
- Object
- Spree::Base
- SolidusPromotions::Condition
- SolidusPromotions::Conditions::PriceOptionValue
- Includes:
- OptionValueCondition
- Defined in:
- app/models/solidus_promotions/conditions/price_option_value.rb
Instance Method Summary collapse
Methods included from OptionValueCondition
included, #preferred_eligible_values
Methods inherited from SolidusPromotions::Condition
#applicable?, applicable_to, #eligibility_errors, #eligible?, eligible_method_for, inherited, #level, #preload_relations, #to_partial_path, #updateable?
Instance Method Details
#price_eligible?(price, _options = {}) ⇒ Boolean
8 9 10 11 12 13 |
# File 'app/models/solidus_promotions/conditions/price_option_value.rb', line 8 def price_eligible?(price, = {}) pid = price.variant.product_id ovids = price.variant.option_value_ids product_ids.include?(pid) && (value_ids(pid) & ovids).present? end |