mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Ensure shops display as closed when not configured for sales
squashme squashme squash squash squash
This commit is contained in:
committed by
Maikel Linke
parent
4fe5e60967
commit
1f2c6f2a85
@@ -26,6 +26,8 @@ class BaseController < ApplicationController
|
||||
@order_cycles = OrderCycle.with_distributor(@distributor).active
|
||||
.order(@distributor.preferred_shopfront_order_cycle_order)
|
||||
|
||||
ensure_shop_ready
|
||||
|
||||
applicator = OpenFoodNetwork::TagRuleApplicator.new(@distributor, "FilterOrderCycles", current_customer.andand.tag_list)
|
||||
applicator.filter!(@order_cycles)
|
||||
|
||||
@@ -34,4 +36,9 @@ class BaseController < ApplicationController
|
||||
current_order(true).set_order_cycle! @order_cycles.first
|
||||
end
|
||||
end
|
||||
|
||||
def ensure_shop_ready
|
||||
# Don't display order cycles if shop is not ready for checkout
|
||||
@order_cycles = {} unless @distributor.ready_for_checkout?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user