Sha256: 259acb37da4dd557311054bd0ed7800e586b7fd3aebe387c987a823596fb5980
Contents?: true
Size: 492 Bytes
Versions: 5
Compression:
Stored size: 492 Bytes
Contents
# frozen_string_literal: true module SolidusPromotions module Conditions class ShippingMethod < Condition include ShipmentLevelCondition preference :shipping_method_ids, type: :array, default: [] def applicable?(promotable) promotable.is_a?(Spree::Shipment) || promotable.is_a?(Spree::ShippingRate) end def eligible?(promotable) promotable.shipping_method&.id&.in?(preferred_shipping_method_ids.map(&:to_i)) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems