0
當在類似於/服裝的分類羣頁面上時,我如何將其更改爲僅顯示服裝中的產品而非服裝及其子分類?在taxons_controller.rb是它使用spree只顯示當前分類羣中的產品而不是當前分類羣和後代
get_base_scope
而這又是使用電話
@searcher = build_searcher(params.merge(:taxon => @taxon.id))
@products = @searcher.retrieve_products
在retrieve_products https://github.com/spree/spree/blob/85da083faf81a4b0150e183d2f7aec988e674b07/core/lib/spree/core/search/base.rb#L15:
base_scope.in_taxon(taxon) unless taxon.blank?
https://github.com/spree/spree/blob/b66ea0229646062acb7b6f89ac2447f5ffc862fb/core/app/models/spree/product/scopes.rb#L78甚至說,它包括的範圍後人。我如何覆蓋這個只顯示當前類別的產品?