Replies: 3 comments
-
@Minirock did you try something like this ? $collection = $this->_categoryLayerFactory
->create()
->setCurrentCategory($category)
->getProductCollection(); Or // $collectionFactory must be a Magento\CatalogSearch\Model\ResourceModel\Fulltext\CollectionFactory
$collection = $layer->prepareProductCollection($collectionFactory->create()) |
Beta Was this translation helpful? Give feedback.
-
Hi thanks for your reply, this was actually our first shot and totally changed our approach in the meantime. Now we managed to get almost what we want. We have a custom route When we enter that url we managed to have a pre filtered collection, the sorting and filter seems to work so as the toolbar and the product count. So lets enter more in details of the code we made, i've been creating a custom Block. You will see in our Block that we filter on a field libelle which makes that this url will give us our filtered collection items printed properly http://sa.dev-aims.fr/testplate/index/index But with the issue on the filter considering the whole products mentionned above. Now if i enter any filter in the url http://sa.dev-aims.fr/testplate/index/index/?tws_piece_marque_veh=OPEL Then everything is fine, i have my filter taking the libelle from the pre filtering and the brand being filtered from the url...and i guess when we have a filter in the url there is a treatment done in the layer that i'm not doing when i have no parameter in the url to filter...which makes the filter applied wrong on the first loading of the page.
And here is our layout
And in the template we have this
|
Beta Was this translation helpful? Give feedback.
-
Hi @Minirock this is too specific for being answered here as part of the Open Source maintenance of Elasticsuite. I move this into a discussion so that maybe someone from the community will be able to help you. If you want more help directly from the Elasticsuite core team, that's something we can provide as paid support to your customer. If you are interested, contact us by mail at [email protected] regards |
Beta Was this translation helpful? Give feedback.
-
Environment :
Do you guys have a working full example of how to load a custom collection in frontend using smile ?
I already can do the job going to a virtual category url and adding my filter parameters in the url as magento works there is no issue with that but i would like to be able to achieve the same result by directly altering the collection without any parameters in the url.
If i analyse it the error make sense as addSortFilterParameters is only defined in smille and not in the magento 2 collection. But i can't really understand why it's not using the smile fulltext collection directly.
I have lots of code so i could provide it but if someone have a working solution I wouldn't say no ;)
I have been trying something but end up facing a wall with this error
Beta Was this translation helpful? Give feedback.
All reactions