Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product sorting doesn`t work for 1column template #332

Closed
deiserh opened this issue Feb 14, 2017 · 4 comments
Closed

Product sorting doesn`t work for 1column template #332

deiserh opened this issue Feb 14, 2017 · 4 comments

Comments

@deiserh
Copy link

deiserh commented Feb 14, 2017

If a one column template is used for the category view page the sorting doesn`t work. The reason for that is, that the filter will be moved from sidebar.main container to content.top container. The elastic module loads the collection on _renderFilterBefore.

The Problem is, that on a one column template the _renderFilterBefore will be called before the sort order from toolbarblock (part of content container) is added to the query.

Magento Version: 2.1.3
Elasticsuite Version: 2.3.1

@romainruaud
Copy link
Collaborator

Hello @deiserh,

I just tested it by switching a category layout to "1 column", and I don't see any problem regarding the sorting.

Do you use the standard "1 column" layout or are you using a custom one ?

@deiserh
Copy link
Author

deiserh commented Feb 14, 2017

Hi,

I thought that the 1 column layout are the standard one. But after your comment I tried to switch the layout in the category from 1 column to 2 column and this doesn`t work neither, so I assume the fault is on our site. I am Sorry for the effort.

@deiserh deiserh closed this as completed Feb 14, 2017
@romainruaud
Copy link
Collaborator

No problem,

issues concerning sorting/filtering are often due to the same causes :

  • you have a layout which is moving the product_list_toolbar block outside the ListProduct block.
  • you have a layout which is removing the product_list_toolbar.
  • you have a layout which is rendering the layered navigation blocks before the product listing.

This is a known problem which is also occuring on the Magento's native search implementation and is due to the strong dependency between the product_list block and the toolbar. You can see the Magento's internal issue tracked here : magento/magento2#7253

Best regards,

@scher200
Copy link

scher200 commented Jun 26, 2017

@romainruaud We are on the newest version of your module and on Magento 2.1.6 and experience a page-reload on changing an order- of sort- option on both catalog- and search-page, but nothing changes to the product order or sorting.

- you have a layout which is moving the product_list_toolbar block outside the ListProduct block
- you have a layout which is removing the product_list_toolbar.
- you have a layout which is rendering the layered navigation blocks before the product listing.

Checked your list, but all was well, still no response to the variables. After debugging I found out that even in the Block/Product/ProductList/Toolbar.php:

                $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());

where tested to be the right Order and Direction value as users enter in at the frontend, still Smile-SA does not seem to use them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants