Hello, I am trying to get the total of products on...
# support
a
Hello, I am trying to get the total of products on the product search page. Based on the source code, the code for index page looks like this right?
Copy code
def index
   @searcher = build_searcher(params.merge(include_images: true))
   @products = @searcher.retrieve_products
   @taxonomies = Spree::Taxonomy.includes(root: :children)
end
I would like to know based on the code above, is there any way to get the count of the total products included on the search parameter?
p
you can use
@products.total_count
a
I acknowledge it is super late, (due to me contracted covid-19), but thank you very much for your suggestion! It works
p
No worries! Glad it worked. Hope you are feeling okay
🤩 1