Find current_customer via current_distributor and current_user rather than current_order

Moving available_payment_methods to enterprises_helper, as per available_shipping_methods
This commit is contained in:
Rob Harrington
2016-05-27 23:26:31 +10:00
parent 07384edb2d
commit 7028fbe288
14 changed files with 274 additions and 260 deletions

View File

@@ -21,8 +21,7 @@ class BaseController < ApplicationController
@order_cycles = OrderCycle.with_distributor(@distributor).active
.order(@distributor.preferred_shopfront_order_cycle_order)
customer_tags = current_order.andand.customer.andand.tag_list
applicator = OpenFoodNetwork::TagRuleApplicator.new(@distributor, "FilterOrderCycles", customer_tags)
applicator = OpenFoodNetwork::TagRuleApplicator.new(@distributor, "FilterOrderCycles", current_customer.andand.tag_list)
applicator.filter!(@order_cycles)
# And default to the only order cycle if there's only the one