Jump to content
thirty bees forum
  • 0

Can't select category root in multistore


exuraz

Question

Hi, I'm on Prestashop 1.6.1.20 (although the shop didn't start out on that version, it has likely been updated multiple times) and I'm trying to set up a multistore environment. The category hierarchy is as follows: Root > Home > Other categories.

When creating a new multistore store I need to select a 'Category root'. My only option here is to select 'Root'. When trying to submit this, it gives an error that I need to select at least one root category. For the default shop, the category root is 'Home'. I am guessing this is what has to be selected rather than 'Root', but the option is not there. I tested this theory on a fresh 1.6.1.20 installation with only sample data and there it does work, with the category root option being 'Home' instead of 'Root'. A screenshot of what it looks like: https://imgur.com/wqOTEp7 And here are screenshots of some of the database tables regarding categories: https://imgur.com/a/tT3RGJk What can I do to fix this? It seems like something messed up inbetween updates, since a fresh installation works properly.

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 1

@Traumflug (a moderator and developer of TB) earlier gently responded to your other (multistore issue) thread and recommended that you migrate to TB. Rest assured TB code base is much better than PS 1.6 (and so is the community & management) and you will get much more positive response here if and when you have any issue with it than when keeping on posting issues with a competing shopping cart, even if TB is based on that cart.

  • Like 1
Link to comment
Share on other sites

  • 0

@doclucas said in Can't select category root in multistore:

@Traumflug (a moderator and developer of TB) earlier gently responded to your other (multistore issue) thread and recommended that you migrate to TB. Rest assured TB code base is much better than PS 1.6 (and so is the community & management) and you will get much more positive response here if and when you have any issue with it than when keeping on posting issues with a competing shopping cart, even if TB is based on that cart.

Fair point. Of course I am taking it into consideration. But I can't just switch in one day. I need to convince my customer, as he will have to pay for it.

But hey, I get that this is a Thirty Bees forum and not a Prestashop forum. So I'll look into migrating a PS test environment to TB and see if the issue persists there.

I'm sorry if my Prestashop related questions have offended anyone. I'm just looking for a good community, and I figured it'd not be a big problem since PS and TB have the same codebase.

Link to comment
Share on other sites

  • 0

Hi All,

I have the same issue but I don't know exactly what I need to fix. I have updated PS from 1.x to 1.6 to TB. When I was using PS 1.x(4 or 5) I used the multi-store function but in 1.6 I stopped using it.
Now I want to use it again but when I add a new store it says:  ''You must select at least one main category.'' What do I need to check and change in the DB to get this working?

I see when I stopped using the multi-store I didn't remove the data and just put Multi-store off. There is an old store in it. When I try to use that I get an 500 error on the 2nd domain.

I hope you can help me out! If any details is needed please let me know!

Link to comment
Share on other sites

  • 0

Basically structure of Prestashop is as follows:

Category id 1 is root category. This category should (or even must) exist.

All other categories must have parent > 0\. So for standard Prestashop its  
1 (Root) with parent 0;  
2 (Home) with parent 1; (this - meaning value of 2 -  should be set in your store as HOME category in settings for your shop)  

Things complicate if you have multistore and want a different category tree. Let's assume you want Category 123 to be home category of your second shop, then:

123 (Home of 2nd shop) should have Parent 1* and in Configuration of 2nd store HOME category should be set to 123.  
Note: * - It does not need to be 1... it may be 2 for example - but only if you want to - for example - setup second shop and use one of your existing categories and products in 2nd shop.

For example, you may sell bikes and parts.... and you have Category tree like:

1 - ROOT (parent=0)  
        2 HOME  (parent=1)  
            3 Bikes (parent=2)  
            4 Bike Parts (parent=2)  
            5 Bike Cloths (parent=2)  
        6 HOME2 (parent=1)  
            7 Laptops (parent=6)

    For SHOPID = 1 you may want to have 2 as HOME_CATEGORY - it will sell all products  
    For SHOPID = 2 you may want to have 4 as HOME_CATEGORY - meaning it will only sell bike parts  
    For SHOPID = 3 you may want to have 6 as HOME_CATEGORY - meaning it will use different tree

    Also note, that modyfing anything in category 4 will have effect in Shops 1 and 2 but not 3.

Edited by Kashir2000
Link to comment
Share on other sites

  • 0
On 6/27/2019 at 11:45 AM, DorkV89 said:

Hi All,

I have the same issue but I don't know exactly what I need to fix. I have updated PS from 1.x to 1.6 to TB. When I was using PS 1.x(4 or 5) I used the multi-store function but in 1.6 I stopped using it.
Now I want to use it again but when I add a new store it says:  ''You must select at least one main category.'' What do I need to check and change in the DB to get this working?

I see when I stopped using the multi-store I didn't remove the data and just put Multi-store off. There is an old store in it. When I try to use that I get an 500 error on the 2nd domain.

I hope you can help me out! If any details is needed please let me know!

Could it be that you had defined a home category for that shop that no longer exists?

Link to comment
Share on other sites

  • 0
On 6/27/2019 at 4:45 AM, DorkV89 said:

I stopped using the multi-store I didn't remove the data

Did you turn multistore on in PS before you migrated?  Maybe if you had it off during the migration TB couldn't migrate the old data correctly.  Did you go back to the old store and turn Multistore back on in PS 1.6 are you sure it worked there?

Link to comment
Share on other sites

  • 0

Thanks for all your replies! 

Okay, so when I re-use the old Multistore I get the 500 error. This only was caused by the conversion rate was not set. When I set the conversion rate it works. But this uses wrong settings (products, categories share)
So this is not a option because this all have to be done manually...

3 hours ago, Factor said:

You don't say what theme you are using.  Have you checked the Block top menu to see what is selected there?  also did you go to block layered navigation.  check the theme pages.

I am using a bought theme, but because I use Prestashop from 2012 and have several stores I know I have to check there what categories I can choose. 

2 hours ago, Factor said:

Did you turn multistore on in PS before you migrated?  Maybe if you had it off during the migration TB couldn't migrate the old data correctly.  Did you go back to the old store and turn Multistore back on in PS 1.6 are you sure it worked there?

I wasn't using it in PS 1.6 anymore, I thin I break it in 1.5 or something.
 

4 hours ago, musicmaster said:

Could it be that you had defined a home category for that shop that no longer exists?

I will add the screenshot from my database below. As far as I can see I am using the home as the root categorie en that's why I can't choose the Home as the main category.
I want to add a domain with the same products, categories and theme, just an other country.

 


 

Link to comment
Share on other sites

  • 0
7 hours ago, Kashir2000 said:

Basically structure of Prestashop is as follows:

Category id 1 is root category. This category should (or even must) exist.

All other categories must have parent > 0\. So for standard Prestashop its  
1 (Root) with parent 0;  
2 (Home) with parent 1; (this - meaning value of 2 -  should be set in your store as HOME category in settings for your shop)  

Things complicate if you have multistore and want a different category tree. Let's assume you want Category 123 to be home category of your second shop, then:

123 (Home of 2nd shop) should have Parent 1* and in Configuration of 2nd store HOME category should be set to 123.  
Note: * - It does not need to be 1... it may be 2 for example - but only if you want to - for example - setup second shop and use one of your existing categories and products in 2nd shop.

For example, you may sell bikes and parts.... and you have Category tree like:

1 - ROOT (parent=0)  
        2 HOME  (parent=1)  
            3 Bikes (parent=2)  
            4 Bike Parts (parent=2)  
            5 Bike Cloths (parent=2)  
        6 HOME2 (parent=1)  
            7 Laptops (parent=6)

    For SHOPID = 1 you may want to have 2 as HOME_CATEGORY - it will sell all products  
    For SHOPID = 2 you may want to have 4 as HOME_CATEGORY - meaning it will only sell bike parts  
    For SHOPID = 3 you may want to have 6 as HOME_CATEGORY - meaning it will use different tree

    Also note, that modyfing anything in category 4 will have effect in Shops 1 and 2 but not 3.

It looks like I am using Home as Root?

 

PHPmyadmin.png

Link to comment
Share on other sites

  • 0

1 is not always the root. When you have an upgrade from Prestashop 1.4 "1" is Home and the root has some high id number. In 1.4 Home was the base level. In 1.5 multishop was introduced and Root was added to come under the Homes of the different shops. Given that id_category is an auto-increase field that meant that it got the next free id_category.

So my guess would be that 60 could be your Root. But you don't show it so we can't see its parent.

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...