Where are the NAMES categories stored in magento?

It looks like it should be a search question, but I couldn't find it.

Where is the NAME category stored in the magento database? I see it catalog_category_entity

has a key id and then there are other EAV tables. But I can't seem to find the actual name of the category stored in any prefixed table catalog_category

.

At least with products, there is a SKU (some human readable value) in the catalog_products_entity table.

+3


source to share


3 answers


The category names are in the table catalog_category_entity_varchar

The request you are looking for:



select cat.*, cv.value as `category_name` from `catalog_category_entity` as cat
    join `catalog_category_entity_varchar` as cv on cat.entity_id = cv.`entity_id`
    join `eav_attribute` as att on att.`attribute_id` = cv.`attribute_id`
    join `eav_entity_type` as aty on att.`entity_type_id` = aty.`entity_type_id`
    where aty.`entity_model` = 'catalog/category' and att.`attribute_code` = 'name' and cv.`store_id` = 0

      

Note that this is the name of your categories for your default repository.
If you have multiple stores or shops in your purple, you just need to adjust the condition cv.`store_id` = 0

.
A list of your stores can be found in the tablecore_store

+4


source


'name' is an EAV attribute of type VARCHAR, so you can find the values ​​for that attribute in the table catalog_category_entity_varchar

, but it contains all the values ​​for attributes of type VARCHAR, so to query only values ​​for name, you have to find what is the id of the attribute you are can be found in this table eav_attributes

using something like:



SELECT * FROM  `eav_attribute` WHERE  `entity_type_id` = ##CATEGORY ENTITY TYPE ID## AND  `attribute_code` =  'name'

      

+2


source


If you have an ID with you, this works:

SELECT DISTINCT value

, entity_id

FROM catalog_category_entity_varchar

WHERE entity_id

IN (category id) AND attribute_id

= 111 AND STORE

= 0

Be sure to replace "Category ID" with a comma separated ID and store ID. ) is the standard store identifier.

0


source







All Articles