cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3.2 - Products with same position in category sorting issue

Magento 2.3.2 - Products with same position in category sorting issue

Hello,

We recently migrated a store from M1 to M2.3 - the site has thousands of products and hundreds of categories.

Within each category, there are several instances whereby more than one product has the same position value. Why this is? I don't know. 

Anyway, this category is sorted by "Best Value", which as I understand it, is position followed by entity_id (sorted in ascending order). So basically if 2 products have the same position, the one with the lowest ID is displayed first. 

In Magento 2 though, it appears that it's the product with the highest ID first. So the category now has a big chunk of products listed backwards.

For example:

Magento 1
1) ID: 25, Pos: 0
2) ID: 53, Pos: 1

3) ID: 18, Pos: 2

4) ID: 25, Pos: 2

5) ID: 88, Pos: 2

 

In Magento 2, this would appear like
1) ID: 25, Pos: 0
2) ID: 53, Pos: 1

3) ID: 88, Pos: 2

4) ID: 25, Pos: 2

5) ID: 18, Pos: 2

So Product 18 and 88 have swapped places.

 

 



As you can imagine, this is causing us immeasurable grief because the owner of the website is very precious about their positioning. It'll take a lot of manual work to re-assign the positions and prevent duplication.

We've created dummy categories in a couple of other M2 websites and the same thing does happen.

I've spent hours looking for any documentation or reasoning as to why the entity_id direction has changed, but I can't find a thing. 

Can anyone suggest where I'd begin when attempting to fix this? I can't see anything in the CMS, which is expected as it's such a niche thing.

Also, If there's anyone out there who can tell me that this isn't all in my head (and there is documentation on the change somewhere), it would also help me sleep more soundly at night!


1 REPLY 1

Re: Magento 2.3.2 - Products with same position in category sorting issue

Hello @tmaharding 

 

Please refer the below links:

https://docs.magento.com/m2/ce/user_guide/catalog/categories-category-products.html

 

https://magento.stackexchange.com/questions/121215/magento-2-get-custom-collection-by-asc-sort-order...

 

It might be helpful to you.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"