Module: Workarea::Search::Storefront::Product::Facets::ClassMethods

Defined in:
app/models/workarea/search/storefront/product/facets.rb

Instance Method Summary collapse

Instance Method Details

#current_product_rule_fieldsHash

A hash representing current fields available for product rules. Keys are the displayable name, values are the fields as mapped in the search index.



15
16
17
18
19
20
21
22
# File 'app/models/workarea/search/storefront/product/facets.rb', line 15

def current_product_rule_fields
  Workarea.config.product_rule_fields.merge(
    Workarea::Search::Settings.current.terms_facets.reduce({}) do |memo, facet|
      memo[facet] = "facets.#{facet.systemize}"
      memo
    end
  )
end

#current_terms_facetsArray<String>

The current facets to use when searching for products.



28
29
30
# File 'app/models/workarea/search/storefront/product/facets.rb', line 28

def current_terms_facets
  ['category'] + Workarea::Search::Settings.current.terms_facets
end