Module: SpreeCmCommissioner::LineItems::FindByVariantDecorator
- Defined in:
- app/finders/spree_cm_commissioner/line_items/find_by_variant_decorator.rb
Instance Method Summary collapse
Instance Method Details
#execute(order:, variant:, options: {}) ⇒ Object
ovveride
5 6 7 8 9 10 11 12 13 |
# File 'app/finders/spree_cm_commissioner/line_items/find_by_variant_decorator.rb', line 5 def execute(order:, variant:, options: {}) return super unless variant.product.product_type == 'transit' order.line_items.detect do |line_item| next if [:date].present? && !(line_item.variant_id == variant.id && line_item.date == [:date]) Spree::Dependencies.cart_compare_line_items_service.constantize.call(order: order, line_item: line_item, options: ).value end end |