Jump to content

Questions About "root Categories"


Recommended Posts

I modified the "home" (root) category and set the "visible" flag to false... but it still appears.

 

I created a new category "sample" child of the "home" category and it doesn't matter if this new category is set to "root" or not... there's no difference (at least, I didn't see it).

 

Can someone explain me how they work, please?

 

Thanks!

Link to comment
Share on other sites

I'm having the same problem, i have a main category that contains categories, and products under those second level categories, but the main category whether set to ROOT or not.. (which i dono also what is it for) but i thought if we set a category as root, it should no more show products within it.. in may example.. when i click on main category in the store, it tells "no products in this category" and i don't want any products in this main category...

 

anyone can help us please ?

PS 1.5.3

Link to comment
Share on other sites

ok, concerning my case, i searched the word "root" in category related TPL files.. it is never mentioned... so i added an if statement in the category.tpl file under template folder.. and therefore, this:

 <div class="resumecat category-product-count">
  {include file="$tpl_dir./category-count.tpl"}
 </div>

On line 40.. became this:

 {if !$category->is_root_category}
 <div class="resumecat category-product-count">
  {include file="$tpl_dir./category-count.tpl"}
 </div>
 {/if}

 

now when in BO i set a category as root, i don't put products in it only sub categories, and in the store a root category will never show or count how many products in it..

 

hope this helps someone.. but if anyone can still explain what the root option was meant for it will be great !

Edited by zAy (see edit history)
Link to comment
Share on other sites

The root category is for example necessary in multi-shop mode. Imagine you have 3 stores with different or partly different products and categories so it is very usefull that you can assign a root category for each store. The root category also reflects the "home" category of each store so if you don't want to have the same products in the homepage category you need different root categories.

This way it is easier to assign categories to each store and you can have different prodcuts in the home category. I hope you get the idea.

@marcis. The setting of the root category imo only makes sense in multistore mode. When you create a new shop instance you can assign a new shop root so if you make it invisible in single store mode the only logic effect would be, that you shop is more or less unusable so it might be that presta devs added the exception that disabling root cat in that context is nonsense and ignore that or... that part is not finished so far. Short notice ... the design of multishop is great but imo not finished 100% ... so you have to prepare for such inconsistencies and should operate with extreme caution ;)

Best regards, trip

Edited by Trip (see edit history)
  • Like 1
Link to comment
Share on other sites

Ok thank you Trip, idea is clear now,

I messed up the code a little as i have one shop, so it won't cause problems, i just made the root categories as ones that hold sub categories only and no products, they can show their image and description when clicked, and sub categories only show their small image under root category but not when clicked on.. they just list products.

also root categories will not count products anymore, and in the top horizontal menu i removed the drop down to force users to click on root category..

modified also tpl and css, to remove the description borders and allow html description...

 

now i'm satisfied !

Cheers.

Link to comment
Share on other sites

  • 2 months later...

The root category is for example necessary in multi-shop mode. Imagine you have 3 stores with different or partly different products and categories so it is very usefull that you can assign a root category for each store. The root category also reflects the "home" category of each store so if you don't want to have the same products in the homepage category you need different root categories.

This way it is easier to assign categories to each store and you can have different prodcuts in the home category. I hope you get the idea.

@marcis. The setting of the root category imo only makes sense in multistore mode. When you create a new shop instance you can assign a new shop root so if you make it invisible in single store mode the only logic effect would be, that you shop is more or less unusable so it might be that presta devs added the exception that disabling root cat in that context is nonsense and ignore that or... that part is not finished so far. Short notice ... the design of multishop is great but imo not finished 100% ... so you have to prepare for such inconsistencies and should operate with extreme caution ;)

Best regards, trip

 

It looks like the categories-code in multistore is a little foobar sometimes.

I have two shops.

In shop1 I have category ID 4 which is "Category title A"

In shop2 I ALSO have category ID 4 which is "Category title B"

 

Shop 2 doesn't show it's own category, it shows Shop 1 categery for ID 4.

 

Also - When I click "Edit" on the Home-category, and then choose that the Home-category only is associated with Shop 1 (I am deselecting Shop 2) - I get an infinite loop, when trying to make a new category in Shop 2.

 

This infinite loop shows up as soon as I visit Catalog -> Categories from Shop 2. Sure because I've removed Shop 2's homecategory, but how am I supposed to make a new home-category for Shop 2, when all I see is an error because of the loop?

 

Do you know anything about this?

Edited by Gomlers (see edit history)
Link to comment
Share on other sites

At Marcis, you read the part with "the design of multishop is great but imo not finished 100%" ? I am playing now with that feature since the beginning of 1.5.X branch. Due to the fact that I posted a lot uf bugs on the bug tracker my opinion is that multishop, at least the way I want to use it, is maybe usable with version 1.5.4.1. Before that the root category thing was a mess at least in my case with an upgraded shop unusable. Look here http://forge.prestashop.com/browse/PSCFV-7685

 

Thanks to Remi it was fixed here https://github.com/PrestaShop/PrestaShop/commit/f43aee9a254be22846fbb4a568d2a3e76b84aaef and commited to version 1.5.4.1

 

So anyone using multistore in a fancy way with an upgraded shop from imo 1.4.X should upgrade to the latest version.

PS. is a work in progress and I agree that this should be unavailable in single store mode but there are other annoyences and more serious bugs that are of more importance I thinl.

Greetz, trip

 

@Gomlers, if not already happened, I would upgrade to the latest version first and see if the bug is fixed. As said Multi Shop is work in progress and slowly evolves. There are more incostincies atm but I think it might be usable. Maybe check in under 'edit categories' if the cats are associated correct. It is often overseen that at the bottom you can associate the categories too to the different store instances.

Goof luck, trip

Link to comment
Share on other sites

I'm sure you have more important bugs to fix. But sometimes, I think PrestaShop would be much better if some details were adjusted. I'm talking about very simple issues that, in MY opinion, should be solved before adding more & more features.

 

Anyway, thanks for your work and your help!

Link to comment
Share on other sites

Yepp,

imo MS was the latest part and therefore not tested very well. From my experiece ps developers are more or less only fixing the bugs reported in the bug tracker but on the other hand there might be to many different configurations and so on. It is simply impossible to test every case, especially when there are only a hand full of coders working on that. And this is the open source think. We get a lot for free but we pay it with our help in debugging and/or answering questions here. There are a lot of comercial alternatives where you can spend the whole day in the suport line untill they fix your problem.

I lost a lot of time and nerves untill Multishop became usable but on the other hand sometimes I am positivly supprised how often ps developers are asking for shop access to help people with certain problems in the bug tracker. I think this is not the case in every OS project. So thumbs up for that ;)

Edited by Trip (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 3 years later...
×
×
  • Create New...