Hi, I have two questions about the solidus starter...
# support
d
Hi, I have two questions about the solidus starter frontend handling taxons. In the
TaxonController#show
to retrieve the list of all products in the given taxon, you go through the searcher_class - search for products having the given taxon_id. Why is this instead of using
@taxon.products
or
@taxon.classifications
? I also wonder how the search class is respecting Classification#position, I don't find any references to this in
Spree::Core::Search::Base
.
k
Hey @Daniel Senff, good question! The searcher, when a taxon is present in the params, calls the in_taxon method, which in turns, uses the classification relationship. On top of that, you can benefit from the other features of the searcher, like filtering or using custom scopes in the query URL to retrieve the more accurate results. Of course, feel free to just change the controller code if you need a more linear flow, it really depends on the UX of your store.
d
Filtering, is very good reasoning! Got it, thanks!
👍 1