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
Allow changing the position of products in a category in the catalog > product page #14879
Conversation
Hello,
It's not perfect but that works |
@ABarailler Can you tell me what was the error? SELECT id_product
FROM `' . _DB_PREFIX_ . 'category_product` cp
WHERE cp.`id_category` = ' . (int) $categoryId . ' AND cp.`id_product` IN (' . $productsIds . ')
ORDER BY FIELD(cp.`id_product`, ' . $productsIds . ') Which is already done by the: 'INNER JOIN `' . _DB_PREFIX_ . 'product` p ON (cp.`id_product` = p.`id_product`) ' .
" . Shop::addSqlAssociation('product', 'p') . ' ' .
// AND
'ORDER BY FIELD(cp.`id_product`, ' . $productsIds . ')'; Same for AS cp2 ON cp2.id_product = p.id_product Which is 'INNER JOIN `' . _DB_PREFIX_ . 'product` p ON (cp.`id_product` = p.`id_product`) ' . |
No problem @PierreRambaud, It's probably not the best solution, but I can't find a better way right now. |
@ABarailler Thanks for explanation. Your solution isn't working for me 😅 |
OK on one project I found a case that my SQL doesn't work. Thanks for the fix @PierreRambaud |
@ABarailler Thanks to you for helping us to make this project better 😸 |
…iple tables is not working
@PierreRambaud The problem is fixed if we use the icon in position column. The product is selected and we can change the position and saved and all changes is validated. Since this PR correct the problem it's OK a New issue was created for the second issue : #15291 |
Hello I use the AdminProductDataUpdater.php file found here and doesn't work for me PS:1.7.6.3 |
@marlon8511 Furthermore, there is still an issue about this not fixed: #14616 (comment) |
This change is