Magento - how are categories joined to stores, and to each other

67 views Asked by At

we are using Magento with multiple stores. Each store has categories starting with a root category. I understand that the store is a core_store entity, and category is a catalog_category_entity record, and that they are joined somehow in the EAV attributes table. But I have a few questions on this:

  1. Category C is a subcategory of B is a subcategory of A, i.e. A > B > C - how are the relationships between A and B, and B and C stored?
  2. How is the store joined in? Is there a join table, or is there a column allowing for the category to be listed in a table multiple times, each with a different value for the store field?
1

There are 1 answers

0
AudioBubble On BEST ANSWER

You can easily look at the tables and figure this out yourself.

  1. In catalog_category_entity, the subcategories are linked to parent by the parent_id column. This column is also in the flat tables.

  2. If you look in catalog_category_entity_varchar for the category name attribute for example, there's a store_id column. 0 is the default value, 1 is for store view 1, etc. All this means is that on the front end, if say Store View 1 is showing, then the value for the category name is the row in the table with store_id 1. For example, if your category name is "Hello" in Store View 1 English, then it might be "Hola" in Store View 2 Spanish, and so on.