magento / devdocs

Magento Developer Documentation
https://devdocs.magento.com
Open Software License 3.0
673 stars 1.77k forks source link

Add a page about adding layered navigation to custom product collections #9551

Open ioweb-gr opened 1 year ago

ioweb-gr commented 1 year ago

Is there an existing issue for this?

What's missing?

In Magento 1 it was pretty straightforward how to create your own custom collections with layered navigation or how to override categories' product collection to achieve tailored listing for specific use cases.

In Magento 2 there is no documentation on how to achieve this and searching online you can only find scattered examples where nothing is fully working. EIther the product count is wrong, either the results are wrong or the toolbard is not working.

I think many merchants would like to be able to show custom pages like new products / sale products / products grouped by an attribute and getting the collection is easy.

However showing the product list with layered navigation is a totally different story

Just take a search here and you'll see what I mean

https://magento.stackexchange.com/search?q=custom+product+collection

Dozens of unanswered questions about the topic and answers that are not working.

Realistically speaking, it's worth a topic on it's own in the documentation in my humble opinion.

Two distinct use cases are coming to mind

  1. Custom Product Collection displayed by a controller similar to a category with layered navigation
  2. Modifying a category's product collection and layered navigation to add some custom filtering to provide chosen products that will sell better.

Would it be possible to give us some insight on how to achieve this?

m2-assistant[bot] commented 1 year ago

Hi @ioweb-gr. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information. Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.