diff --git a/app/controllers/spree/checkout_controller_decorator.rb b/app/controllers/spree/checkout_controller_decorator.rb index d005a94..b5cabe2 100644 --- a/app/controllers/spree/checkout_controller_decorator.rb +++ b/app/controllers/spree/checkout_controller_decorator.rb @@ -190,13 +190,15 @@ module Spree if @order.update_attributes(object_params) if params[:order][:coupon_code] and !params[:order][:coupon_code].blank? and @order.coupon_code.present? + event_name = "spree.checkout.coupon_code_added" if promo = Spree::Promotion.with_coupon_code(@order.coupon_code).where(:event_name => event_name).first - fire_event('spree.checkout.coupon_code_added', :coupon_code => @order.coupon_code) + fire_event(event_name, :coupon_code => @order.coupon_code) else flash[:error] = t(:promotion_not_found) render :edit and return end + end end