Skip to content

Commit

Permalink
Fixed bug where taxon display would not work correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed May 7, 2012
1 parent a5ab8a6 commit 19163b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/overrides/add_search_pagination.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
:name => "add_sunspot_search_pagination",
:replace => "code[erb-silent]:contains('if paginated_products.respond_to')",
:closing_selector => "code[erb-silent]:contains('end')",
:original => "<%= helper_method %>",
:text => "<%= paginate @searcher.sunspot.hits %>")
:text => "<%= paginate @searcher.sunspot.hits unless params.has_key? 'taxon' %>")
5 changes: 4 additions & 1 deletion lib/spree/search/spree_sunspot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def retrieve_products
# - we are sending the block value as a method
# - Spree::Search::Base is using method_missing() to return the param values

(PRODUCT_OPTION_FACETS + PRODUCT_PROPERTY_FACETS + PRODUCT_OTHER_FACETS + [:taxon_name]).each do |name|
(PRODUCT_OPTION_FACETS + PRODUCT_PROPERTY_FACETS + PRODUCT_OTHER_FACETS + PRODUCT_SHOW_FACETS).each do |name|
with("#{name}_facet", send(name)) if send(name)
facet("#{name}_facet")
end
Expand Down Expand Up @@ -39,6 +39,9 @@ def prepare(params)

@properties[:sort] = params[:sort] || :score
@properties[:order] = params[:order] || :desc

# when taxon navigation is in place, Spree::TaxonsController passes :taxon in params
@properties[:taxon_name_facet] = params[:taxon] unless params[:taxon].blank?

(PRODUCT_OPTION_FACETS + PRODUCT_PROPERTY_FACETS + PRODUCT_OTHER_FACETS + PRODUCT_SHOW_FACETS).each do |name|
@properties[name] = params["#{name}_facet"]
Expand Down

0 comments on commit 19163b3

Please sign in to comment.