fitgura Posted May 12, 2011 Share Posted May 12, 2011 Hi PS users!I upgraded my 1.3.6 to PS 1.4.1 and as I see, when I make a new category in the new edition evry categoriy is just displayed on the end of the category list....what could be the problem??? Link to comment Share on other sites More sharing options...
fitgura Posted May 12, 2011 Author Share Posted May 12, 2011 And unfortunately - evry newly opened category just see in the subcategory of the prviously addad category - as I see it on the product page!but the home category page is just shown on the last position?is it a bug? Link to comment Share on other sites More sharing options...
fitgura Posted May 12, 2011 Author Share Posted May 12, 2011 please help me! Link to comment Share on other sites More sharing options...
fitgura Posted May 12, 2011 Author Share Posted May 12, 2011 I think it could be the problem with the ccc and html/js compression!but the most bad thing is that the new category just put into the last category on the root Link to comment Share on other sites More sharing options...
fitgura Posted May 12, 2011 Author Share Posted May 12, 2011 I was check the ps_category table in my database and evrything look finethe parent category is 1 what means it could show under the root, the position is 75 what means this is a 75th row in the category!so it could be the problem with the displaying not with the program!please someone help me find this out Link to comment Share on other sites More sharing options...
tomerg3 Posted May 12, 2011 Share Posted May 12, 2011 I was check the ps_category table in my database and evrything look finethe parent category is 1 what means it could show under the root, the position is 75 what means this is a 75th row in the category!so it could be the problem with the displaying not with the program!please someone help me find this out How can anyone help if you're not even posting a link to your site?Did you try to resort the categories in the backoffice?PS < 1.4 was using numbers for order, in PS 1.4+ there is a new sort order field in the database, which is used to display them in order. Link to comment Share on other sites More sharing options...
fitgura Posted May 12, 2011 Author Share Posted May 12, 2011 Hi tomergOf course I set the order of the category (what I created last time) to the exact position!The category looks fine in the BObut if I start to add a new product --> this last created category what could be on root ---> just appear in the last root category as a subcategory!And I don't know why!for example:ABCD are my root categories --> if I wanna create E on the root --> the result will beABCD-E Link to comment Share on other sites More sharing options...
slx Posted May 12, 2011 Share Posted May 12, 2011 I had the same problem and I discovered that the problem was with the column "level_depth" value for the category table. Because in the display php code the database request order by level_depth and position field.This value should be set according of the level on the category three. 1 for first level, 2 for second level, and so on...http://www.prestashop.com/forums/viewthread/98989/ (In french ) .Hope it will help you Link to comment Share on other sites More sharing options...
fitgura Posted May 13, 2011 Author Share Posted May 13, 2011 Yes! I find it out when I checked the ps_category table, but it is not dispalying on the root, even if the level depth is right!That is why I do not understand what happening Link to comment Share on other sites More sharing options...
slx Posted May 13, 2011 Share Posted May 13, 2011 Yes! I find it out when I checked the ps_category table, but it is not dispalying on the root, even if the level depth is right!That is why I do not understand what happening I think that the best thing to do in your case is to extract the SQL statement from the Category.php source code and play it in the phpmyadmin sql screen. Then you should see how (there is an "order by" ) is extract information from database and anderstand wich value is not correct.For information in my source code the statement is in the fileprestashop\modules\blockcategories\blockcategories.php line 151So here is (mine) the sql statement used. As you can see the request depends of lang settings and group valueThe variables used in this statement are :LANG-VARIABLE = your shop langage idCATEGORY-VARIABLE = your category idLEVEL-TO-DISPLAY = number of Level to displayGROUP-TO-DISPLAY = Group ID to display (it depends of the nature of clients)SELECT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewriteFROM ps_category cLEFT JOIN ps_category_lang cl ON (c.id_category = cl.id_category AND id_lang = LANG-VARIABLE)LEFT JOIN ps_category_group cg ON (cg.id_category = c.id_category)WHERE (c.active = 1 OR c.id_category = CATEGORY-VARIABLE)AND level_depth <= LEVEL-TO-DISPLAY AND cg.id_group = GROUP-TO-DISPLAYORDER BY level_depth ASC, c.position ASC Link to comment Share on other sites More sharing options...
fitgura Posted May 13, 2011 Author Share Posted May 13, 2011 the problem is I don't understand exactly mysql requests Link to comment Share on other sites More sharing options...
fitgura Posted May 13, 2011 Author Share Posted May 13, 2011 Please watch the picture, what I am talking about:my last added category is the "puzzle" what I created under the root (when I created it, doesn't matter what is the first letter, it creates as the last one on the category tab)1st question (is it normal to put the category to the last position? after it I manually pull it up to the 75. position (because we need abc ordering to show categories)see it on the first pic marked with redsee the phpmyadmin pics about the database position on pics 2BUT when I want to add a new product, there is something wrong, because this category is just under something else in the end of the root categories.. please see pic 3IS IT A BUG! Link to comment Share on other sites More sharing options...
fitgura Posted May 13, 2011 Author Share Posted May 13, 2011 Could somebody tell me what is nleft and nright column in the ps_category table??? Link to comment Share on other sites More sharing options...
slx Posted May 13, 2011 Share Posted May 13, 2011 Please watch the picture, what I am talking about:my last added category is the "puzzle" what I created under the root (when I created it, doesn't matter what is the first letter, it creates as the last one on the category tab)1st question (is it normal to put the category to the last position? after it I manually pull it up to the 75. position (because we need abc ordering to show categories)see it on the first pic marked with redsee the phpmyadmin pics about the database position on pics 2BUT when I want to add a new product, there is something wrong, because this category is just under something else in the end of the root categories.. please see pic 3IS IT A BUG! Yes, there is a bug. What you describe is what i lived too. And to solve the problem, you must adjust thé depth-level column value. I'll try to post more detail solution this evening Link to comment Share on other sites More sharing options...
slx Posted May 13, 2011 Share Posted May 13, 2011 Please watch the picture, what I am talking about:my last added category is the "puzzle" what I created under the root (when I created it, doesn't matter what is the first letter, it creates as the last one on the category tab)1st question (is it normal to put the category to the last position? after it I manually pull it up to the 75. position (because we need abc ordering to show categories)see it on the first pic marked with redsee the phpmyadmin pics about the database position on pics 2BUT when I want to add a new product, there is something wrong, because this category is just under something else in the end of the root categories.. please see pic 3IS IT A BUG! So I re check on my database and do some test. And For me you have the same that me and de solution is : Update the column level_depth to 1 where the id_category = 238. refresh screen and you should see the item at the true place.Remember that the position value is the position in the level. Link to comment Share on other sites More sharing options...
devilsown Posted May 14, 2011 Share Posted May 14, 2011 I had this same issue. Did you use oscommerce importer? Link to comment Share on other sites More sharing options...
slx Posted May 14, 2011 Share Posted May 14, 2011 I had this same issue. Did you use oscommerce importer? No. I upgraded the shop from version 1.3.5 to 1.4.0.17 and to 1.4.1 Link to comment Share on other sites More sharing options...
slx Posted May 14, 2011 Share Posted May 14, 2011 I found the final point of this problem on the prestashop bug reporthere http://forge.prestashop.com/browse/PSCFI-1596The main problem is the found the reason.... the first category (home) must have level_depth at ZERO!don't know why it was set up to 'ONE' maybe from previous updates.because the script when you update category change the level depth value to the parent one + 1. So I updated the row of my firs category and now each new category is coorctly created in the tree. Link to comment Share on other sites More sharing options...
fitgura Posted May 15, 2011 Author Share Posted May 15, 2011 Hi dmsft!thanks for your reply...yes it solve my problem temporary, but dou you know any solution, why any newly created category get 1 level deeper where I create it???anybody know about this bug?devilsown: NO I dod not use oscommerce importer, that plugin is totally deleted.. Link to comment Share on other sites More sharing options...
slx Posted May 17, 2011 Share Posted May 17, 2011 Hi dmsft!thanks for your reply...yes it solve my problem temporary, but dou you know any solution, why any newly created category get 1 level deeper where I create it???.... This is because your First Category level depth is si to 1 rather 0. Look at it in your database.This solution worked for me. And now my new categories are correctly created.What I anderstand of this bug is that the problem is in the migration procedure. It's set the first category level_depth value to 1 rather than 0.... And this was the beginning of our problems.... Maybe you could find more detailed information in the prestashop bug report. Link to comment Share on other sites More sharing options...
fitgura Posted May 17, 2011 Author Share Posted May 17, 2011 Great THX dmsft!that is work now!!! Link to comment Share on other sites More sharing options...
Recommended Posts