butlerov Posted April 29, 2020 Share Posted April 29, 2020 (edited) Hi. When i use drap and drop to change subcategory positon it's say Succesfull, but after page reload nothing happens. In chrome console i got [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. send @ jquery-1.11.0.min.js:4 ajax @ jquery-1.11.0.min.js:4 onDrop @ dnd.js:145 mouseup @ jquery.tablednd.js:262 dispatch @ jquery-1.11.0.min.js:3 r.handle @ jquery-1.11.0.min.js:3 but i can change products positions.Presta version 1.6.1.16. Changing position in phpmyadmin does not work. What sql query should i put to change positions of subcategories? or maybe what change here https://github.com/PrestaShop/PrestaShop/pull/6749 but i dunno products still change positions and can be saved as usual. Thanks. Edited April 29, 2020 by butlerov (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted April 29, 2020 Share Posted April 29, 2020 Could you please execute this query and paste the result? SELECT `id_product`, count(*) FROM `ps_category_product` WHERE `id_category` = '2' /* Set your category ID */ GROUP BY `position` HAVING count(*) > 1; Link to comment Share on other sites More sharing options...
butlerov Posted April 29, 2020 Author Share Posted April 29, 2020 (edited) 1 hour ago, joseantgv said: Could you please execute this query and paste the result? SELECT `id_product`, count(*) FROM `ps_category_product` WHERE `id_category` = '2' /* Set your category ID */ GROUP BY `position` HAVING count(*) > 1; Well i set id_category some irrelevant category with 8 subcategories and no products in them and BO sql manager said This SQL query returned an empty result. Another category with subcategories and products said but real amount of products in is not correct id_product count(*) 5099 23 Target category with subcategories and products where i want to change some position of subcategories returns This SQL query returned an empty result. So some categories returns empty even there a products in them and some incorrect number of products in them if understand this query count how many products in category But i dont need products, wanna change ps_category position but when i changed position of one category in phpmyadmin to 3 in BO that category position was still 26 Edited April 29, 2020 by butlerov (see edit history) Link to comment Share on other sites More sharing options...
butlerov Posted April 30, 2020 Author Share Posted April 30, 2020 (edited) Maybe someone help which sql query should i put in sql manager? Changing all position of certain idcategoryparent dosent change position in BO at all. Maybe it happens because UPDATE method used by phpmyadmin not allowed. thanks Well seems change postions of categories "kinda" worked. What i did, created a new subcategory then i turn on and off rest of subcategories, after that i can change position by drap and drop from BELOW to the TOP(from top to below doesnt work) all the categories and after reload the page they stayed when i left them. Edited April 30, 2020 by butlerov (see edit history) Link to comment Share on other sites More sharing options...
musicmaster Posted May 1, 2020 Share Posted May 1, 2020 You cannot change the position of categories by just changing the position fields. The software maintains a kind of tree of all your categories that is managed by the nleft and nright fields. This makes it quite complicated. 1 Link to comment Share on other sites More sharing options...
musicmaster Posted May 22, 2020 Share Posted May 22, 2020 Note that there is a trick to make this work: when you create or move some category in the backoffice the tree will be re-calculated - including all the changes you made in the database parent and position fields. 1 Link to comment Share on other sites More sharing options...
butlerov Posted May 23, 2020 Author Share Posted May 23, 2020 16 hours ago, musicmaster said: Note that there is a trick to make this work: when you create or move some category in the backoffice the tree will be re-calculated - including all the changes you made in the database parent and position fields. Yes, I also noticed this when created new categories and positions rearranged. It is a pity that this trick does not work for products. Have to turn off the product, change it position and turn it on. Link to comment Share on other sites More sharing options...
musicmaster Posted May 24, 2020 Share Posted May 24, 2020 23 hours ago, butlerov said: Yes, I also noticed this when created new categories and positions rearranged. It is a pity that this trick does not work for products. Have to turn off the product, change it position and turn it on. With products it is just a caching problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now