mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Add comments linking areas concerned with separating products by distributor and order cycle
This commit is contained in:
@@ -6,6 +6,10 @@ module Spree
|
||||
root_taxon.children.map do |taxon|
|
||||
css_class = (current_taxon && current_taxon.self_and_ancestors.include?(taxon)) ? 'current' : nil
|
||||
|
||||
# The concern of separating products by distributor and order cycle is dealt with in
|
||||
# a few other places: OpenFoodWeb::Searcher (for searching over products) and in
|
||||
# OpenFoodWeb::SplitProductsByDistributor (for splitting the main product display).
|
||||
|
||||
products = Product.in_taxon(taxon)
|
||||
products = products.in_distributor(current_distributor) if current_distributor
|
||||
products = products.in_order_cycle(current_order_cycle) if current_order_cycle
|
||||
|
||||
@@ -14,6 +14,10 @@ module OpenFoodWeb
|
||||
def get_base_scope
|
||||
base_scope = super
|
||||
|
||||
# The concern of separating products by distributor and order cycle is dealt with in
|
||||
# a few other places: OpenFoodWeb::SplitProductsByDistributor (for splitting the main
|
||||
# product display) and Spree::BaseHelper decorator (for taxon counts).
|
||||
|
||||
base_scope = base_scope.in_supplier_or_distributor(enterprise_id) if enterprise_id
|
||||
base_scope = base_scope.in_supplier(supplier_id) if supplier_id
|
||||
base_scope = base_scope.in_distributor(distributor_id) if distributor_id
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
module OpenFoodWeb
|
||||
module SplitProductsByDistributor
|
||||
|
||||
# The concern of separating products by distributor and order cycle is dealt with in a few
|
||||
# other places: OpenFoodWeb::Searcher (for searching over products) and in
|
||||
# Spree::BaseHelper decorator (for taxon counts).
|
||||
|
||||
module SplitProductsByDistributor
|
||||
# If a distributor is provided, split the list of products into local (at that
|
||||
# distributor) and remote (at another distributor). If a distributor is not
|
||||
# provided, perform no split.
|
||||
|
||||
Reference in New Issue
Block a user