I have a problem with product sorting, see my example below. The sorting works fine, but the faceted search gives problems. As you can see, product ID 131 has position 5 on my 'Donuts' category. So you would expect that is will be the fifth item on my products page. But, product ID 131 shows up as the second item on my page. This is because it has more catagories, where it has another position. On the category 'Baby Thema', it has position 1. This gives the problem that is also comes 'first' on my products overview page, but I want it as fifth item there.
How can I fix this? Hopefully my problem is clear.

PrestaShop version: prestashop:1.7.6.5
PHP version: 7.1
Faceted search version: 3.6.0
Thanks for opening this issue! We will help you to keep its state consistent
Hi @Sybrenb,
Thanks for your issue.
Please think about using the template @Sybrenb, you deleted everything of the GitHub's template when creating the issue For example, we don't know your PS version, your PHP version, or even the faceted search module version.
This does not help us at all.
Unfortunately, there is not enough information provided to reproduce it and work on it. You must follow the template to submit a complete bug report.
Read more about how we expect the issues to be handled here.
Thanks to edit your description.
It seems like this is an Prestashop 1.7 bug. As you can see below, product ID 131 has 2 categories. category 10 is the parent and category 35 the sub category. While this product has position 6 on the parent, is has position 1 on the sub category. The problem is that when I order on position on the parent category products page, this productswil sort as position 1 and not as postition 6.
Can anybody please help me how to fix this? It is a big problem for me.

The problem of re-ordering is fixed if we use the icon in the position column. The product is selected and we can change the position and saved and all changes is validated.
Here's the PR: #14879 to fix the issue.
It is fixed in the PS1.7.7.0.
Since this PR correct the problem it's OK a New issue was created for the second issue: #15291
Thanks to check and feedback.
@khouloudbelguith Thank you for your quick response. However, this is not the same problem. I can re-order the products and it saves, but the sub category product position overrules the parent product position.
Hi @Sybrenb,
I tried with 1770beta2 using the demo product where id_product=1.

The product is associated with 3 categories


Position in Clothes category = 4
=> FO => OK

Positions in Men Category = 2
=> FO => OK

Thanks to check and feedback.
So as I understand, this is an 1.7.6 bug and can't be fixed?
@Sybrenbn, as commented here
in fact it is fixed in the PS1770.
So, can we close this issue?
Thanks!
@khouloudbelguith
@Bahbv, thanks!
Yeah, they seem similar but did you tried with 1770beta2?
In my case, it is ok in my case with 1770beta2.
Thanks!
@khouloudbelguith Tested just now, problem still exists for me.
PHP-version: 7.2.30
PrestaShop-version: 1.7.7.0 (beta 2)
Faceted search: 3.5.0
Default ordering: Positions inside category
Fresh prestashop install, only thing i did was adding 2 test items in the categorys Clothes and Men.
BO Category Clothes
Products seem to be ignoring their positions inside Clothes category, but taking their position from the subcategorys. This shouldn't be the case.
Front-end
BO Category Clothes > Men
The order in this subcategory is correct.
Front-end
Hi @Bahbv,
Thanks to upgrade the ps_facetedsearch module.
The last release is 3.6.0.
I attached a screen record using PS1770beta2 and ps_facetedsearch v3.6.0.
https://drive.google.com/file/d/1I3UTL3BFWofKU0lgx_-FxENVt7SbybUX/view?usp=sharing
Thanks to check and feedback.
I have the same issue on ps_facetedsearch 3.6.0.
@Sybrenb, are you using PS1770beta2 or PS1767?
Thanks!
Hello @khouloudbelguith
I find it weird it works for you. I'm still experiencing the same issue with ps_facetedsearch 3.6.0.
I included a screen record of my own for you to check out. What could be different in our setups?
Ordering in the subcategory has an effect on the category above... Ordering in the category above doesn't work.
https://drive.google.com/file/d/1sDlzKyRWmo84Kcz3wiwoRwSyEuOKGi-7/view?usp=sharing
@Bahbv, could you check positions into the ps_category_product table.
https://drive.google.com/file/d/1zj-0cGJg9wnLbPpGvrPZivDkXIax3-dy/view?usp=sharing
Thanks to check and feedback.
@khouloudbelguith, I've tried PS1770beta2 and ps_facetedsearch 3.6.0. but the problem still occurs. As seen above in my example, the positions of the products with a sub category overrules the positions of the parent category position of the product.
Do you know where I can edit the SQL query which shows and sort the products on the product page? Maybe we can fix it that way.
@khouloudbelguith positions in the database seems to be fine. It's indeed the overruling like @sybrenb mentioned.
I made an annotated export of ps_category_products.
ps_category_product-pdf.pdf
And a screenshot of my prestashop configuration
Thanks for looking into this,
Hi @Bahbv, @Sybrenb,
I check again and it is ok
I attached a screen record
https://drive.google.com/file/d/1O2eFEnxfRJehUfZqlBzpJOHciyAHlIcP/view?usp=sharing
@Sybrenb,
the positions of the products with a sub category overrules the positions of the parent category position of the product.
You can change manually positions from the Database table ps-category_product as we have already this issue: #15291.
Despite our several trials, we could not reproduce your issue with the provided information.
It seems that your issue is not a PrestaShop's core bug but most likely a server configuration or customization problem.
I invite you to contact our support team: http://addons.prestashop.com/en/388-support to help you solve your issue.
Thanks!