Class: Spree::Search::MultiDomain

Inherits:
Base
  • Object
show all
Defined in:
lib/spree/search/multi_domain.rb

Instance Method Summary collapse

Instance Method Details

#get_base_scopeObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/spree/search/multi_domain.rb', line 3

def get_base_scope
  base_scope = @cached_product_group ? @cached_product_group.products.active : Product.active
  base_scope = base_scope.by_store(current_store_id) if current_store_id
  base_scope = base_scope.in_taxon(taxon) unless taxon.blank?
  
  
  base_scope = get_products_conditions_for(base_scope, keywords) unless keywords.blank?

  base_scope = base_scope.on_hand unless Spree::Config[:show_zero_stock_products]
  base_scope
end

#prepare(params) ⇒ Object



15
16
17
18
# File 'lib/spree/search/multi_domain.rb', line 15

def prepare(params)
  super
  @properties[:current_store_id] = params[:current_store_id]
end