Skip to content

Commit

Permalink
Use permitted attributes to retrieve coupon code
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyadsl committed May 11, 2018
1 parent 4497ef5 commit 212287a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/app/controllers/spree/checkout_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def completion_route
end

def apply_coupon_code
if params[:order] && params[:order][:coupon_code].present?
@order.coupon_code = params[:order][:coupon_code]
if update_params[:coupon_code].present?
@order.coupon_code = update_params[:coupon_code]

handler = PromotionHandler::Coupon.new(@order).apply

Expand Down
4 changes: 2 additions & 2 deletions frontend/app/controllers/spree/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def assign_order
end

def apply_coupon_code
if params[:order] && params[:order][:coupon_code].present?
@order.coupon_code = params[:order][:coupon_code]
if order_params[:coupon_code].present?
@order.coupon_code = order_params[:coupon_code]

handler = PromotionHandler::Coupon.new(@order).apply

Expand Down

0 comments on commit 212287a

Please sign in to comment.