【发布时间】:2013-02-13 11:58:12
【问题描述】:
我正在运行 Spree 1.3.1,并且正在尝试自定义分类显示页面。
我希望它返回当前分类单元中包含的产品,最终按属性或选项值过滤。
例如,假设我正在查看内衣系列的分类。 我想通过提供一定的尺寸(option_type)来过滤显示的产品。 在这种情况下,我应该只列出具有要求尺寸的变体的产品。
我还希望能够按“适合”属性过滤产品。 通过滑动配合过滤,我应该能够仅列出当前分类单元中具有所需属性的产品。
这是 Taxon 控制器的显示操作:
Spree::TaxonsController.class_eval do
def show
@taxon = Spree::Taxon.find_by_permalink!(params[:id])
return unless @taxon
@searcher = Spree::Config.searcher_class.new(params)
@searcher.current_user = try_spree_current_user
@searcher.current_currency = current_currency
@products = @searcher.retrieve_products
respond_with(@taxon)
end
end
我应该如何修改它以满足我的需要?
【问题讨论】:
标签: ruby-on-rails spree