Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

fix sort value resetting #2

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

DevertNet
Copy link

If the attribute is not filled, no products will be found with this query. This will result in a wrong product order.
For performance reasons you could add a if condition in the foreach.

If the attribute is not filled, no products will be found with this query. This will result in a wrong product order.
For performance reasons you could add a if condition in the foreach.
@punkstar
Copy link
Contributor

@DevertNet Thanks for the contribution, but I don't follow what's going on here and what your change fixes.

As I understand it the collection that you modified is looking for all products that have a quantity that is not zero and setting it to zero. That means that all products in the database now have an integer there and not a null value. The aim of that code isn't to zero the entire catalogue.

Is there a specific bug that you're fixing?

@DevertNet
Copy link
Author

Yes, if the products have a null value, the sorting will be wrong.
Depending on ASC/DESC the result will be -1, -2, -3, null, null, null, ... or null, null, null, ..., -3, -2, -1, .
If they have a zero (0) value it will be: -3, -2, -1, 0, 0, 0, ... or 0, 0, 0, ..., -1, -2, -3.

@sprankhub
Copy link
Contributor

I think #4 fixes your issue @DevertNet.

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

Successfully merging this pull request may close these issues.

3 participants