Update app/controllers/spree/checkout_controller_decorator.rb

This commit is contained in:
Scott Wagner 2012-05-16 13:02:48 -07:00
parent 1a5111c10d
commit 09df0aaf4a
1 changed files with 5 additions and 1 deletions

View File

@ -177,10 +177,14 @@ module Spree
def redirect_to_paypal_express_form_if_needed
return unless (params[:state] == "payment")
return unless params[:order][:payments_attributes]
if params[:order][:coupon_code]
@order.update_attributes(object_params)
@order.process_coupon_code
if @order.coupon_code.present?
fire_event('spree.checkout.coupon_code_added', :coupon_code => @order.coupon_code)
end
end
load_order
payment_method = Spree::PaymentMethod.find(params[:order][:payments_attributes].first[:payment_method_id])