Sha256: 4000027a112605b69155036b9ec1ead5899349857f538a69a48e546b65792290

Contents?: true

Size: 388 Bytes

Versions: 20

Compression:

Stored size: 388 Bytes

Contents

module Spree
  class Promotion
    module Actions
      class FreeShipping < Spree::PromotionAction
        include Spree::AdjustmentSource

        def perform(payload = {})
          order = payload[:order]
          create_unique_adjustments(order, order.shipments)
        end

        def compute_amount(shipment)
          shipment.cost * -1
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
spree_core-3.4.6 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.6.6 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.6.5 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.6.4 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.6.3 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.6.2 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.6.1 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.6.0 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.5.0 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.6.0.rc1 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.5.0.rc2 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.5.0.rc1 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.4.5 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.4.4 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.4.3 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.4.2 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.4.1 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.4.0 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.4.0.rc2 app/models/spree/promotion/actions/free_shipping.rb
spree_core-3.4.0.rc1 app/models/spree/promotion/actions/free_shipping.rb