Sha256: 1b6ce4a95a8068396d15a21a247c0d55e55d0fd8697a0315af41a0db8b5db1fd

Contents?: true

Size: 407 Bytes

Versions: 4

Compression:

Stored size: 407 Bytes

Contents

# frozen_string_literal: true

module SolidusFriendlyPromotions
  module Benefits
    class AdjustShipment < Benefit
      def can_discount?(object)
        object.is_a?(Spree::Shipment) || object.is_a?(Spree::ShippingRate)
      end

      def level
        :shipment
      end

      def possible_conditions
        super + SolidusFriendlyPromotions.config.shipment_conditions
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_friendly_promotions-1.9.3 app/models/solidus_friendly_promotions/benefits/adjust_shipment.rb
solidus_friendly_promotions-1.9.2 app/models/solidus_friendly_promotions/benefits/adjust_shipment.rb
solidus_friendly_promotions-1.9.1 app/models/solidus_friendly_promotions/benefits/adjust_shipment.rb
solidus_friendly_promotions-1.9.0 app/models/solidus_friendly_promotions/benefits/adjust_shipment.rb