Showing order cycle close time on banner when multiple open orders are present

This commit is contained in:
Rob Harrington
2017-05-05 12:20:00 +10:00
parent c3eda435eb
commit 8c8b40c5a8
2 changed files with 3 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ module Spree
end
def changeable_orders
# Only returns open order for the current user + shop + oc combo
return [] unless spree_current_user && current_distributor && current_order_cycle
Spree::Order.complete.where(
state: 'complete',
@@ -36,7 +37,7 @@ module Spree
path: changeable_orders_link_path,
order: changeable_orders.first.number,
shop: current_distributor.name,
oc_close: l(current_order_cycle.orders_close_at, format: "%b %d, %Y %H:%M"))
oc_close: l(current_order_cycle.orders_close_at, format: "%A, %b %d, %Y @ %H:%M"))
end
end
end

View File

@@ -897,7 +897,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
shop_changeable_orders_alert_html:
one: Your order with <a href='%{path}' target='_blank'>%{shop} / %{order}</a> is open for review. You can make changes until %{oc_close}.
other: You have <a href='%{path}' target='_blank'>%{count} orders with %{shop}</a> currently open for review.
other: You have <a href='%{path}' target='_blank'>%{count} orders with %{shop}</a> currently open for review. You can make changes until %{oc_close}.
orders_changeable_orders_alert_html: This order has been confirmed, but you can make changes until <strong>%{oc_close}</strong>.
products_clear_all: Clear all