Module: MuckCommerce::DiscountMethods

Defined in:
lib/muck-commerce/share/discount_methods.rb

Instance Method Summary collapse

Instance Method Details

#calculate_discounts(amount, coupon_codes) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/muck-commerce/share/discount_methods.rb', line 4

def calculate_discounts(amount, coupon_codes)
  coupons = []
  coupon_amount = 0
  coupon_override = false
  if MuckCommerce.configuration.enable_coupons && coupon_codes
    coupons, coupon_amount, coupon_override = Coupon.calculate_total_discount(amount, coupon_codes)
  end
  [coupons, coupon_amount, coupon_override]
end