This commit is contained in:
Brian Quinn 2012-11-06 19:43:17 +00:00
parent 405acab005
commit a95329aa9e
1 changed files with 3 additions and 1 deletions

View File

@ -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