Sha256: b433e438c23a3d8caef5a0ec158c1901ddd9a97ed7c0f0a809130037907cd859

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

module Workarea
  decorate Pricing::Discount::ApplicationGroup, with: :global_e do
    def apply
      return super unless order.fixed_pricing?

      discounts.each do |discount|
        discount_order = Pricing::Discount::Order.new(order, shippings, discount)
        next unless discount.qualifies?(discount_order)

        discount.apply(discount_order)
        international_discount_order = Pricing::Discount::InternationalOrder.new(order, shippings, discount)
        discount.apply(international_discount_order)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
workarea-global_e-1.3.0 app/models/workarea/pricing/discount/appliation_group.decorator
workarea-global_e-1.2.1 app/models/workarea/pricing/discount/appliation_group.decorator