[email protected] Posted June 13, 2016 Share Posted June 13, 2016 Hello, I wanted to change the shop-id which still showed the old name I used to start the shop. I found that when I switched ON multistore, that at advanced settings I could change the old name of the shop to the current name. i did that and then clicked save, and then in settings I switched OFF multistore. Then I found out that all my subcategories where missing in the front-end, they are still in the database but I can't reach them. Apparently I did not associate all the categories when I saved the settings in multistore (they where not all checked only the main categories) Is there a way to RE-associate them? I did go back, switched on multistore and then tried to associate, but there I can now only see these same categories and not the subcategories. There must be a way???? Please help (we have about 250 (sub)categories so changing them by hand in de database is not an option. Links to subcategories don't work as well and give 404 https://eenhoorn.eu/nl/cadeaus/gelegenheid/vaderdag/ Link to comment Share on other sites More sharing options...
[email protected] Posted June 14, 2016 Author Share Posted June 14, 2016 (edited) My search led to no solution. I'm putting back a backup and add new clients and orders manually Edited June 14, 2016 by [email protected] (see edit history) Link to comment Share on other sites More sharing options...
Artx Posted September 9, 2016 Share Posted September 9, 2016 (edited) Hello, I was in the same situation yesterday --- went to change shop name for one of multistore shops and did not pay attention to categories at all. So, as later I found out, in shop there were left only main categories, with no sub-categories. This definitely have to be fixed in prestashop - should the name update not touch categories, or they should be selected, when doing name editing. I fixed back categories with query in phpMyAdmin (I only had categories in shop with ID 1 - this will add all categories to shop with ID 1, if they are not there already): INSERT INTO `ps_category_shop` ( `id_category` , `id_shop` , `position` ) SELECT id_category, 1, 0 FROM `ps_category` WHERE id_category NOT IN ( SELECT id_category FROM `ps_category_shop` ) Edited September 9, 2016 by Artx (see edit history) Link to comment Share on other sites More sharing options...
shikotak Posted December 23, 2019 Share Posted December 23, 2019 On 9/9/2016 at 11:16 PM, Artx said: Hello, I was in the same situation yesterday --- went to change shop name for one of multistore shops and did not pay attention to categories at all. So, as later I found out, in shop there were left only main categories, with no sub-categories. This definitely have to be fixed in prestashop - should the name update not touch categories, or they should be selected, when doing name editing. I fixed back categories with query in phpMyAdmin (I only had categories in shop with ID 1 - this will add all categories to shop with ID 1, if they are not there already): INSERT INTO `ps_category_shop` ( `id_category` , `id_shop` , `position` ) SELECT id_category, 1, 0 FROM `ps_category` WHERE id_category NOT IN ( SELECT id_category FROM `ps_category_shop` ) Hello, could you explain which table should edit? I have the same problem on Prestashop 1.7.5.0 Link to comment Share on other sites More sharing options...
JurassicVinyls Posted May 15, 2020 Share Posted May 15, 2020 Hello so i noticed a typo in one of my categories, I have changed it in sql as everytime I changed it in the backoffice it didnt appear to want to save. after searching the entire database for the typo and changing it the backoffice was showing the correct spelling... front end however was still showing incorrect thinking it might be cache deleted cache and found the problem was still on the front end. I then disabled all cache and the problem on front end has now gone! but as soon as i renabled cache the typo re appears. Manually checked cache on server and gone incognito to see if was local cache... running out of ideas! Link to comment Share on other sites More sharing options...
alaksa Posted November 3, 2020 Share Posted November 3, 2020 insert into ps_category_shop SELECT a.`id_category`,bb.id_shop,0 FROM `ps_category` as a left join ps_category_shop aa on a.`id_category`=aa.`id_category` left join ps_category as b on a.`id_parent`=b.`id_category` left join ps_category_shop bb on b.`id_category`=bb.`id_category` where a.id_parent>2 and aa.id_shop is null This will restore subcategories for all shops where main categories are used and have no subcategory assigned to a shop. Link to comment Share on other sites More sharing options...
carlosolaran Posted March 4, 2021 Share Posted March 4, 2021 We use your code and works Perfect! But only with subcategories of the first level, we have got second and third levels that did not regenerate. Do you know how we can expand this regeneration of asociation? Thank you very much! Link to comment Share on other sites More sharing options...
apenimon Posted June 16, 2021 Share Posted June 16, 2021 Hi alaksa, can you please clarify this solution little further as I'm totally lost on what I should change on the Database? Are those need to be changed or edited from SQL database? I'm not really sure how to apply your solution. I would really appreciate if you could please give the steps on what to do. Many thanks 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