Skip to content

Commit

Permalink
Add flash when order cannot be changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mkllnk committed Apr 7, 2021
1 parent cf22a86 commit 42543bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/spree/admin/adjustments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def set_order_id
end

def skip_changing_canceled_orders
return unless @order.canceled?

flash[:error] = t("admin.adjustments.skipped_changing_canceled_order")
redirect_to admin_order_adjustments_path(@order) if @order.canceled?
end

Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ en:
rename: "Rename"

admin:
adjustments:
skipped_changing_canceled_order: "You can't change a cancelled order."
# Common properties / models
begins_at: Begins At
begins_on: Begins On
Expand Down

0 comments on commit 42543bf

Please sign in to comment.