Jump to content

Cannot change position of category in BO


butlerov

Recommended Posts

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 by butlerov (see edit history)
Link to comment
Share on other sites

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 by butlerov (see edit history)
Link to comment
Share on other sites

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 by butlerov (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...
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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...