Merge pull request #60 from scottwagner/patch-1

Fixing process_coupon_code on master
This commit is contained in:
Andrew Hooker 2012-05-16 13:06:49 -07:00
commit fb852bc1b2
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])